pyc-website
main website for pyc inc.
git clone https://9o.is/git/pyc-website.git
PasswordChange.js
(889B)
1 angular.module("PasswordChange", ['Forms', 'ngAlert', 'Variables'])
2
3 .controller('PasswordChangeAlert', ['$scope', '$controller', function($scope, $controller) {
4 $controller('AlertCtrl', {$scope: $scope});
5
6 $scope.$on('alertPasswordChange', function(event, alert) {
7 $scope.addAlert(alert);
8 });
9 }])
10
11 .controller('PasswordChangeCtrl', ['$scope', '$controller', '$rootScope', function($scope, $controller, $rootScope) {
12 $controller('FormCtrl', {$scope: $scope});
13 $controller('VariablesCtrl', {$scope: $scope});
14
15 $scope.password_regex = $scope.PASSWORD_REGEXP;
16
17 $scope.save = function() {
18 var success = function(alert) {
19 $rootScope.$broadcast('alertPasswordChange', alert);
20 $scope.reset();
21 };
22
23 var failure = function(alert) {
24 $rootScope.$broadcast('alertPasswordChange', alert);
25 };
26
27 $scope.submit('PasswordChange', 'submit', success, failure);
28 };
29 }]);