pyc-website

main website for pyc inc.

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

AtmApplication.js

(867B)


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