Answer the question
In order to leave comments, you need to log in
Check access to the page. How to implement correctly?
There is a ready-made SPA in which 3 types of users are authorized. I'm trying to write a service that should check the user's account_type whether he has access to the requested page. I got stuck on the test itself.
I run this function through .run
function checkAccess(AccountUtilities, $route, $rootScope) {
$rootScope.$on('$routeChangeStart', function() {
AccountUtilities.accessCheck();
});
}
Answer the question
In order to leave comments, you need to log in
use ui-router. in ui-router, there is a cool feature called resolve.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question