I'm trying to make some button disappear when I logout, but if I don't put reload command It won't reload and button wouldn't disappear. After I put reload command view doesn't change because the process end at reload line.
Here my code :
$scope.logout = function(){
deleteCookie("Username","/");
location.reload();
$location.path('/view1');
}
Please help !
UPATE: app.js
'use strict';
// Declare app level module which depends on views, and components
angular.module('myApp', [
'ngRoute',
'myApp.view1',
'myApp.view2',
'myApp.viewLogin',
'myApp.SaveCafeDetail',
'myApp.viewUserprofile',
'myApp.viewManageuser',
'myApp.viewEditcafe',
'myApp.version'
]).
config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) {
$locationProvider.hashPrefix('!');
$routeProvider.otherwise({redirectTo: '/view1'});
}]);