diff --git a/app/templates/client/app/scripts/app.js b/app/templates/client/app/scripts/app.js index 4ff7176..cae0bf8 100644 --- a/app/templates/client/app/scripts/app.js +++ b/app/templates/client/app/scripts/app.js @@ -57,6 +57,13 @@ angular templateUrl: 'views/login.html', controller: 'LoginCtrl' }) + .state('logout', { + url: '/logout', + templateUrl: 'views/login.html', + controller: function(Auth) { + Auth.logout(); + } + }) .state('dashboard', { abstract: true, url: '', diff --git a/app/templates/client/app/scripts/controllers/dashboard.js b/app/templates/client/app/scripts/controllers/dashboard.js index f5e4b18..a0fc63d 100644 --- a/app/templates/client/app/scripts/controllers/dashboard.js +++ b/app/templates/client/app/scripts/controllers/dashboard.js @@ -8,21 +8,9 @@ * Controller of the clientApp */ angular.module('clientApp') - .controller('DashboardCtrl', function ($scope, account, selectedCompany, Auth, $state, $log) { + .controller('DashboardCtrl', function ($scope, account, selectedCompany) { // Initialize values. $scope.companies = account.companies; $scope.selectedCompany = selectedCompany ? selectedCompany : parseInt(account.companies[0].id); - - - - /** - * Logout current user. - * - * Do whatever cleaning up is required and change state to 'login'. - */ - $scope.logout = function() { - Auth.logout(); - $state.go('login'); - }; }); diff --git a/app/templates/client/app/views/dashboard/main.html b/app/templates/client/app/views/dashboard/main.html index b2e5df5..d32af4d 100644 --- a/app/templates/client/app/views/dashboard/main.html +++ b/app/templates/client/app/views/dashboard/main.html @@ -30,7 +30,7 @@