[AngularJS] Wait for http.post to return Cookie.set

2017-07-11 Thread Zlatko Đurić
Well it's not"after the map" that's the problem here, it's"after the map has resolved". So in your use case when you need to call getRefresh, you would have to chain the two calls; first, call the refresh token endpoint, and when it comes back, than you can use your cookie. So your "resource"

[AngularJS] Wait for http.post to return Cookie.set

2017-07-11 Thread Tommaso Betti
Hi everyone. I'm trying to giving synchronous behavior to my authentication workflow in angular 2 but i can't resolve. Here's the code: saveToken(token){ debugger; var expireDate = 0.0003472; //var expireDate = token.expires_in; Cookie.set("access_token", token.access_token,