1

I need to get jwt token via http module then make other requests with this token in header. How I can make delay of app initialization till token get request resolved?

Rakhat
  • 4,783
  • 4
  • 40
  • 50

1 Answers1

1
this.http.get(...)
.map(response => response.json())
.flatMap(response => this.http.get(...).map(response => response.json())
.subscribe(response => this.result = response);

You can use How to pass parameters rendered from backend to angular2 bootstrap method to delay app-initialization.

Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567