1234567891011121314151617181920212223242526272829303132333435 |
- angular.module('NoteWrangler').controller('NotesEditController', function($scope, $routeParams, Note, Category, Session) {
-
-
-
-
-
- Session.authenticate();
-
-
- $scope.note = Note.get({id: $routeParams.id})
-
- Category.all().then(function(categoryData) {
- $scope.categories = categoryData;
- });
-
- $scope.updateNote = function(note) {
- $scope.errors = null;
- $scope.updating = true;
-
-
-
-
-
-
-
-
- note.$update().catch(function(noteData) {
- $scope.errors = [noteData.data.error];
- }).finally(function() {
- $scope.updating = false;
- });
- };
- });
|