-
Notifications
You must be signed in to change notification settings - Fork 1
/
indexroute.js
48 lines (37 loc) · 1.18 KB
/
indexroute.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
var indexapp= angular.module('indexapp',['ngRoute','angular-loading-bar'])
indexapp.config(['$routeProvider',function($routeProvider){
$routeProvider
.when('/',{
templateUrl:'main.html',
controller:'maincontroller'
})
.when('/primary',{
templateUrl:'login-primary.php',
controller:'primarycontroller'
})
.when('/main',{
templateUrl:'login-main.php',
controller:'indexcontroller'
})
}]);
indexapp.controller('maincontroller',function($scope){
/*$apply(){
$interval(function select(style){
$scope.style={'background-color':'red'}
if($scope.style={'background-color':'red'}){
console.log($scope.style);
$scope.style={'background-color':'green'};
}
},1000);}
*/
});
indexapp.controller('indexcontroller',function($scope,$http){
$http.get("http://localhost/hospitalp/jsonmain.php")
.success(function (data) {$scope.data = data;
console.log($scope.data)});
});
indexapp.controller('primarycontroller',function($scope,$http){
$http.get("http://localhost/hospitalp/jsonprimary.php")
.success(function (data) {$scope.data = data;
console.log($scope.data)});
})