Does anyone know a way that I can pass initialization data into an Angular 2 application built with Angular CLI? I need to pass Access Token that I currently have from a pre-authenticated .NET backend so that I can call an API.
I've tried to do this via a local web api endpoint, but since Observables are async, the module tries to use the value before it's available in the app.
I've already tried the OnRun suggestion by @Ben Nadel Here. The result of my http call still happens AFTER the app is loaded causing my access token to be null when it first is loaded.
Something like @Bilyachat suggested below would work great! Where I could simply do something like the following:
<app-root [apiKey]="1234567890xxxxx"></app-root>
Any help would be awesome... Thanks.