我需要通过http模块获得jwt令牌,然后在标头中使用此令牌发出其他请求。如何延迟应用程序的初始化,直到令牌请求得到解决?
发布于 2016-11-16 13:11:06
this.http.get(...)
.map(response => response.json())
.flatMap(response => this.http.get(...).map(response => response.json())
.subscribe(response => this.result = response);您可以使用How to pass parameters rendered from backend to angular2 bootstrap method延迟应用程序初始化。
https://stackoverflow.com/questions/40632976
复制相似问题