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,563
  • 3
  • 38
  • 49

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
  • 558,509
  • 191
  • 1,911
  • 1,506