2015-06-29 22:51:29 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
2015-07-01 23:14:39 +00:00
|
|
|
angular.module('core').controller('HomeController', ['$rootScope', '$scope', 'User', 'Auth', '$state',
|
|
|
|
function($rootScope, $scope, User, Auth, $state) {
|
|
|
|
$scope = $rootScope;
|
2015-06-30 07:28:29 +00:00
|
|
|
|
2015-06-30 19:42:02 +00:00
|
|
|
console.log($rootScope.user);
|
2015-07-01 23:14:39 +00:00
|
|
|
$scope.user = Auth.ensureHasCurrentUser(User);
|
|
|
|
$scope.authentication = Auth;
|
2015-06-30 19:42:02 +00:00
|
|
|
|
2015-07-01 23:14:39 +00:00
|
|
|
if($scope.authentication.isAuthenticated()){
|
|
|
|
$state.go('listForms');
|
|
|
|
}
|
2015-06-29 22:51:29 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
]);
|