Answer the question
In order to leave comments, you need to log in
How to work with api on angularJS?
The question is: for the application to work with Api, you need to request a session and insert it into each subsequent application request, the problem is that I cannot make the session request come before the entire application works. that is, the application sends new requests while the session has not yet arrived.
I don’t think it’s difficult, but I’m dumb, tell me some working trick.
and the assignment to the rootScope.sessionId variable does not work yet,
although there is a return in sessionFactory.newSession() ..
angular.module('app',[])
.run(function($rootScope, sessionFactory){
$rootScope.SessionId=sessionFactory.newSession();
setInterval(function(){
console.log($rootScope.sessionId);
}, 200 );
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question