Commit 13a6f61f2670cc59628d1a1cec164ff9018d0d29
1 parent
c4874399d3
Exists in
master
and in
1 other branch
Sorry I don't know any other way to test this
Showing 1 changed file with 2 additions and 0 deletions Inline Diff
scripts/RootController.js
View file @
13a6f61
angular.module('flashy.RootController', ['ui.router']). | 1 | 1 | angular.module('flashy.RootController', ['ui.router']). | |
2 | 2 | |||
controller('RootController', ['$rootScope', '$scope', '$state', 'UserService', function($rootScope, $scope, $state, UserService) { | 3 | 3 | controller('RootController', ['$rootScope', '$scope', '$state', 'UserService', function($rootScope, $scope, $state, UserService) { | |
//UserService.getUserData(); | 4 | 4 | //UserService.getUserData(); | |
//$('#top').collapsible('accordion'); | 5 | 5 | //$('#top').collapsible('accordion'); | |
if (UserService.isLoggedIn()) $state.go('login'); | 6 | 6 | if (UserService.isLoggedIn()) $state.go('login'); | |
else $state.go('addclass'); | 7 | 7 | else $state.go('addclass'); | |
$rootScope.isLoggedIn = false; | 8 | 8 | $rootScope.isLoggedIn = false; | |
console.log(UserService._user); | 9 | 9 | console.log(UserService._user); | |
UserService.getUserData().then(function(data) { | 10 | 10 | UserService.getUserData().then(function(data) { | |
console.log(data); | 11 | 11 | console.log(data); | |
$rootScope.user = data; | 12 | 12 | $rootScope.user = data; | |
}); | 13 | 13 | }); | |
14 | 14 | |||
$('.button-collapse').sideNav({ | 15 | 15 | $('.button-collapse').sideNav({ | |
menuWidth: 300, // Default is 240 | 16 | 16 | menuWidth: 300, // Default is 240 | |
edge: 'right', // Choose the horizontal origin | 17 | 17 | edge: 'right', // Choose the horizontal origin | |
closeOnClick: true // Closes side-nav on <a> clicks, useful for Angular/Meteor | 18 | 18 | closeOnClick: true // Closes side-nav on <a> clicks, useful for Angular/Meteor | |
} | 19 | 19 | } | |
); | 20 | 20 | ); | |
21 |