-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
70 lines (61 loc) · 1.94 KB
/
app.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
61
62
63
64
65
66
67
68
69
70
/* scripts/app.js */
(function(){
'use strict';
var languvel = angular.module('languvel', [
'ngResource',
'ui.bootstrap',
'ui.router'
]);
languvel.config(['$httpProvider', function($httpProvider){
$httpProvider.defaults.headers.common["X-Requested-With"] = 'XMLHttpRequest';
}]);
languvel.config(function($stateProvider, $urlRouterProvider, $locationProvider){
//
// For any unmatched url, redirect to /state1
$urlRouterProvider.otherwise(function($injector, $location){
return "state1";
});
//
// Now set up the states
$stateProvider
.state('state1', {
url: "/state1",
templateUrl: "/shared/state1/state1.html"
})
.state('state2', {
url: "/state2",
templateUrl: "/shared/state2/state2.html"
})
.state('sectionA', {
url: "/sectionA",
controller: function(tabFactory){
tabFactory.changeTab('sectionA');
}
})
.state('sectionB', {
url: "/sectionB",
controller: function($rootScope, tabFactory){
tabFactory.getTab2($rootScope.user.id);
tabFactory.changeTab('sectionB');
}
})
.state('dropdown1', {
url: "/dropdown1",
controller: function(tabFactory){
tabFactory.changeTab('dropdown1');
}
})
.state('dropdown2', {
url: "/dropdown2",
controller: function(tabFactory){
tabFactory.changeTab('dropdown2');
}
})
;
$locationProvider
.html5Mode({
enabled: true,
requireBase: false
})
});
})();