123456789101112131415161718192021222324252627282930 |
- angular.module('NoteWrangler').controller('ProfileEditController', function($scope, $location, User, Session) {
-
-
- Session.authenticate();
-
-
- Session.sessionData().success(function(sessionUser) {
-
- $scope.user = new User(sessionUser);
- });
-
- $scope.updateUser = function(user) {
- $scope.errors = null;
- $scope.updating = true;
-
-
-
-
-
-
-
-
- user.$update().catch(function(userData) {
- $scope.errors = [userData.data.error];
- }).finally(function() {
- $scope.updating = false;
- });
- };
- });
|