generator-gae-angular-material-starter
Version:
Google App Engine Angular Material Starter generator
19 lines (16 loc) • 667 B
JavaScript
(function() {
'use strict';
var module = angular.module('users');
module.controller('ProfilePasswordController', function($scope, gaToast, $state, gaBrowserHistory, gaTracking) {
if (!$scope.hasAuthorization()) {
gaBrowserHistory.back();
}
$scope.save = function() {
$scope.user.post('password', $scope.credentials).then(function() {
gaTracking.eventTrack('Password change', $scope.user.username);
gaToast.show('Your password was successfully changed');
$state.go('profile.view', {username : $scope.user.username});
});
};
});
}());