У меня есть панель навигации, содержащая 4 слова (A, B, C, D), когда я зашел в базу данных и удалил, например, (A) по его идентификатору, слово (A) удаляется в меню, но его содержимое остается отображаемым, я хочу удалить также его содержимое, и страница автоматически перешла к логину, как это закончить
controller.js:
User.AccessRole({id:this.user.userId},function (res, req) {
$scope.listmenu=res;
console.info( $scope.listmenu);
//$scope.listmenu.id=remove(listmenu, id);
});
config.js:
.state('aaaa', {
url: "/aaaa",
controller: "aaaa",
templateUrl: "views/aaaa/aaaa.html",
data: { pageTitle: 'aaaa' },
resolve: {
loadPlugin: function ($ocLazyLoad) {
return $ocLazyLoad.load([
'views/aaaa/aaaa.js',
'sweet_alert',
'datatables_lazy',
'fff'
]);
}
},
data: {
role: [roles.SuperAdministrateur,roles.Administrateur,roles.Agent], pageTitle: 'aaaa'
}
})
app.js:
.run(['authService', function (authService) {
authService.fillAuthData();
}])
.run(["$rootScope", "authService", "$state", '$window', function ($rootScope, authService, $state, $window) {
$rootScope.$on("$stateChangeSuccess", function (event, toState) {
var authorizedRoles = toState.data.role;
console.info("from app");
console.info(authorizedRoles);
// authService.authentication.isAuth=true;
if (authService.authentication.isAuth && authService.isAuthorized(authorizedRoles)) {
if (authService.isAuthorized(authorizedRoles) || authorizedRoles === undefined || authorizedRoles.remove(id)) {
console.info("You are authorized");
} else {
$state.go('error.500');
authService.logOut();
}
} else {
$state.go('login');
// $(window).bind('beforeunload', function(){ authService.logOut(); });
}
});
topnavbar.html:
<ul class = "clearfix" style = "margin-top: 0px">
<span ng-repeat = "item in listmenu" >
<li> <a href = "#!{{item.MenuLink}}" ng-if = "item.menu_id!=7"
class = "w3-bar-item w3-button w3-border-right"><center>{{item.designation_menu}}</center></a>
</li>
</span>
</ul>
привет Алексей, я добавляю функцию для кеша, но это не решение, я думаю, мы должны удалить куки для функции






Возможный дубликат Проблема с кешированием в приложении angularJS