|
@@ -16,10 +16,20 @@ var app = angular.module('app', [
|
16
|
16
|
app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationProvider',
|
17
|
17
|
function($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider) {
|
18
|
18
|
|
|
19
|
+ $stateProvider.state('root', {
|
|
20
|
+ abstract: true,
|
|
21
|
+ template: '<div ui-view=""></div>',
|
|
22
|
+ resolve: ['luticateAuthUsers', function(luticateAuthUsers)
|
|
23
|
+ {
|
|
24
|
+ return luticateAuthUsers.loadUserData(null);
|
|
25
|
+ }]
|
|
26
|
+ });
|
|
27
|
+
|
19
|
28
|
//$locationProvider.html5Mode(true);
|
20
|
29
|
|
21
|
30
|
$stateProvider.state('login',{
|
22
|
31
|
url:'/',
|
|
32
|
+ parent: 'root',
|
23
|
33
|
templateUrl:'views/login.html',
|
24
|
34
|
controller:'LoginController',
|
25
|
35
|
resolve:{}
|
|
@@ -27,6 +37,7 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationP
|
27
|
37
|
|
28
|
38
|
$stateProvider.state('home',{
|
29
|
39
|
url:'/home',
|
|
40
|
+ parent: 'root',
|
30
|
41
|
templateUrl:'views/home.html',
|
31
|
42
|
controller:'HomeController',
|
32
|
43
|
revolve:{}
|
|
@@ -52,8 +63,15 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationP
|
52
|
63
|
}]);
|
53
|
64
|
|
54
|
65
|
}])
|
|
66
|
+ .directive('dateNow', ['$filter', function($filter) {
|
|
67
|
+ return {
|
|
68
|
+ link: function( $scope, $element, $attrs) {
|
|
69
|
+ $element.text($filter('date')(new Date(), $attrs.dateNow));
|
|
70
|
+ }
|
|
71
|
+ };
|
|
72
|
+ }])
|
55
|
73
|
.run(['$rootScope', '$state',function ($rootScope, $state) {
|
56
|
74
|
$rootScope.$on('$stateChangeError', function (e, curr, prev) {
|
57
|
|
- $state.go('login');
|
|
75
|
+ //$state.go('login');
|
58
|
76
|
});
|
59
|
77
|
}]);
|