-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathControl.js
60 lines (55 loc) · 1.94 KB
/
Control.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var AccMgt = angular.module('AccMgt',['ngRoute','ngDialog']);
AccMgt.config(['$routeProvider', function($routeProvider){
$routeProvider
.when('/', {
templateUrl: 'templates/welcome.html',
controller:'welcome'
})
/*.when('/welcome', {
templateUrl: 'templates/Welcome.html',
controller:'welcome'
})*/
.when('/signUp', {
templateUrl:'templates/SignUp.html',
controller: 'signUp'
})
.when('/signIn', {
templateUrl:'templates/SignIn.html',
controller:'signIn'
})
.when('/dashBoard', {
templateUrl:'templates/SummeryPage.html',
controller:'summeryPage'
})
.when('/newAccount', {
templateUrl:'templates/NewAccount.html',
controller:'newAccount'
})
.when('/allEntries/:accountID', {
templateUrl:'templates/AllEntry.html',
controller:'allEntries'
})
.otherwise({
redirectTo:"/"
})
}]).
directive('match', function () {
return {
require: 'ngModel',
restrict: 'A',
scope: {
match: '='
},
link: function(scope, elem, attrs, ctrl) {
scope.$watch(function() {
var modelValue = ctrl.$modelValue || ctrl.$$invalidModelValue;
return (ctrl.$pristine && angular.isUndefined(modelValue)) || scope.match === modelValue;
}, function(currentValue) {
ctrl.$setValidity('match', currentValue);
});
}
};
});
/*AccMgt.controller('navController', function($scope){
// function to submit the form after all validation has occurred
})*/