-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathapp.js
More file actions
57 lines (52 loc) · 1.5 KB
/
Copy pathapp.js
File metadata and controls
57 lines (52 loc) · 1.5 KB
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
var storeApp = angular.module('AngularStore', ['ui.router']);
//var storeApp = angular.module('AngularStore', ['ngroute']);
//默认跳转到
storeApp.config(function($urlRouterProvider){
$urlRouterProvider.otherwise('/login');
});
//url不区分大小写
storeApp.config(function($urlMatcherFactoryProvider){
$urlMatcherFactoryProvider.caseInsensitive(false);
});
//路由设置
storeApp.config(['$stateProvider',function($stateProvider){
$stateProvider
.state('index.welcome',{
url:'/welcome',
templateUrl: '/angular/partials/welcome.html',
controller: welcomeController
})
.state('login',{
url:'/login',
templateUrl:'/angular/partials/login.html',
controller: loginController
//controllerAs:'loginCtrl'
})
.state('index',{
url:'/index',
templateUrl: '/angular/partials/index.html',
controller: indexController
// controllerAs:'indexCtrl'
})
.state('index.main',{
url:'/main',
templateUrl: '/angular/partials/store.html',
controller: mainController,
//controllerAs:'mainCtrl'
})
}])
// ngroouter
// storeApp.config(['$routeProvider', function($routeProvider) {
// $routeProvider
// .when('/login',{
// templateUrl:'partials/login.html',
// controller:'loginController'
// })
// .when('/store', {
// templateUrl: 'partials/store.html',
// controller: 'HomeController'
// })
// .otherwise({
// redirectTo: '/login'
// })
// }]);