-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
42 lines (34 loc) · 1.09 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
(function() {
var modules = [
'ui.router', // Router component
'ngAnimate', // Animation support
];
angular.module('transitionApp', modules);
function config($stateProvider, $urlRouterProvider) {
// For any unmatched url, redirect to /state1
$urlRouterProvider.otherwise("/home");
$stateProvider
.state('home', {
url: "/home",
templateUrl: "page-home.html",
controller: "mainController"
})
.state("about", {
url: "/about",
templateUrl: "page-about.html",
controller: "aboutController"
})
.state("contact", {
url: "/contact",
templateUrl: "page-contact.html",
controller: "contactController"
});
}
function run($rootScope, $state, $log) {
$rootScope.back = function(){
alert("Back Clicked");
}
}
angular.module('transitionApp').config(config);
angular.module('transitionApp').run(run);
})();