notes-index-controller.js 364 B

12345678910111213
  1. angular.module("noteWrangler")
  2. .controller("NotesIndexController", ['$scope', 'Note', function ($scope, Note) {
  3. const errorHandler = function (err) {
  4. console.log("Error getting /notes", err);
  5. };
  6. const responseHandler = function (data) {
  7. $scope.notes = data.data;
  8. };
  9. Note.all()
  10. .then(responseHandler, errorHandler);
  11. }]);