G
G
GrimJack2017-06-09 18:41:08
JavaScript
GrimJack, 2017-06-09 18:41:08

Is it possible to do such a cookie check in angular?

In general, you need to constantly check the relevance of cookies and if they are no longer relevant, redirect to a specific page. How can it be implemented less kastylno?
It didn’t work out normally to go on a spree, because. I don't usually work with angular and js.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
ozknemoy, 2017-06-10
@GrimJack

I would check when changing the state (page)
works with ui-router / without it, the stateChangeSuccess event is called differently

.run(function ($rootScope, cookieFactory) {
    'ngInject';
    $rootScope.$on('$stateChangeSuccess',  event =>{
...
    });
})

N
Nicholas, 2017-06-09
@healqq

Constantly - then the service is $interval (almost similar to the standard setInterval). If it is necessary for each interaction with backing through ajax - then $http interceptor on response error.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question