pyc-website

main website for pyc inc.

git clone https://9o.is/git/pyc-website.git

PasswordRecovery.js

(790B)


      1 angular.module("PasswordRecovery", ['Forms', 'ngAlert'])
      2 
      3 .controller('PasswordRecoveryAlert', ['$scope', '$controller', function($scope, $controller) {		
      4 	$controller('AlertCtrl', {$scope: $scope});
      5 
      6 	$scope.$on('alertPasswordRecover', function(event, alert) {
      7 		$scope.addAlert(alert);
      8 	});
      9 }])
     10 
     11 .controller('PasswordRecoveryCtrl', ['$scope', '$controller', '$rootScope', function($scope, $controller, $rootScope) {		
     12 	$controller('FormCtrl', {$scope: $scope});
     13 	
     14     $scope.save = function() {
     15 		var success = function(alert) {
     16 			$rootScope.$broadcast('alertPasswordRecover', alert);
     17 			$scope.reset();
     18 		};
     19 		
     20 		var failure = function(alert) {
     21 			$rootScope.$broadcast('alertPasswordRecover', alert);
     22 		};
     23 		
     24 		$scope.submit('PasswordRecovery', 'submit', success, failure);
     25     };
     26 }]);