Browse Source

footer current year; load user data on init

master
Robin Thoni 9 years ago
parent
commit
0bb1ccd56b
2 changed files with 20 additions and 2 deletions
  1. 19
    1
      app/app.js
  2. 1
    1
      app/views/footer.html

+ 19
- 1
app/app.js View File

16
 app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationProvider',
16
 app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', '$locationProvider',
17
     function($stateProvider, $urlRouterProvider, $httpProvider, $locationProvider) {
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
         //$locationProvider.html5Mode(true);
28
         //$locationProvider.html5Mode(true);
20
 
29
 
21
         $stateProvider.state('login',{
30
         $stateProvider.state('login',{
22
             url:'/',
31
             url:'/',
32
+            parent: 'root',
23
             templateUrl:'views/login.html',
33
             templateUrl:'views/login.html',
24
             controller:'LoginController',
34
             controller:'LoginController',
25
             resolve:{}
35
             resolve:{}
27
 
37
 
28
         $stateProvider.state('home',{
38
         $stateProvider.state('home',{
29
             url:'/home',
39
             url:'/home',
40
+            parent: 'root',
30
             templateUrl:'views/home.html',
41
             templateUrl:'views/home.html',
31
             controller:'HomeController',
42
             controller:'HomeController',
32
             revolve:{}
43
             revolve:{}
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
     .run(['$rootScope', '$state',function ($rootScope, $state) {
73
     .run(['$rootScope', '$state',function ($rootScope, $state) {
56
         $rootScope.$on('$stateChangeError', function (e, curr, prev) {
74
         $rootScope.$on('$stateChangeError', function (e, curr, prev) {
57
-            $state.go('login');
75
+            //$state.go('login');
58
         });
76
         });
59
     }]);
77
     }]);

+ 1
- 1
app/views/footer.html View File

8
     <footer>
8
     <footer>
9
         <div class="row">
9
         <div class="row">
10
             <div class="col-lg-12 text-center">
10
             <div class="col-lg-12 text-center">
11
-                <p>Copyright &copy; App 2015</p>
11
+                <p>Copyright &copy; App <span date-now="yyyy"></span></p>
12
             </div>
12
             </div>
13
         </div>
13
         </div>
14
     </footer>
14
     </footer>

Loading…
Cancel
Save