Answer the question
In order to leave comments, you need to log in
How to make http request in angular 2 before app initialization?
There is such a question: I am making
an application on angular 2 together with google gmail API ( api + authorization)
So the question is, how can I get data (if I have already authorized before) and remove the authorization button during application initialization?
Thanks for the answer
Answer the question
In order to leave comments, you need to log in
if there is routing:
angular.run(function($rootScope){
$rootScope.$on('$routeChangeStart', function(e){
checkAuth().then(function (response) {
// ... всё ок
}, function(response){
// ... всё плохо.
$location.path('/login');
});
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question