-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
31 lines (25 loc) · 800 Bytes
/
Copy pathapp.js
File metadata and controls
31 lines (25 loc) · 800 Bytes
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
// here are defined all application states
var routerApp = angular.module('routerApp', ['ui.router']);
routerApp.run([
"$rootScope", "$state", "$stateParams", function($rootScope, $state, $stateParams) {
$rootScope.$state = $state;
return $rootScope.$stateParams = $stateParams;
}
]);
routerApp.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('home', {
url: '/home',
templateUrl: 'views/home.html',
controller: function($scope){
$scope.tabActive = function($state){
return $state.includes("home");
}
}
})
.state('about', {
url: '/about',
template: '<h2>About</h2>'
});
$urlRouterProvider.otherwise('/home');
});