-
Notifications
You must be signed in to change notification settings - Fork 203
Open
Description
I am using angular CLI and ATOM editor for coding.
I followed your tutorial. My main.ts code is ad follow
import { platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { AppModule } from './app/app.module';
import {ApiConfig} from './app/api.service';
import {AppComponent} from './app/app.component';
if (environment.production) {
enableProdMode();
}
export function initApp(apiUrl: string, apiToken:string, apiSession:string){
// make the config ref to start the new running program
let apiConfig = new ApiConfig();
apiConfig.apiUrl = apiUrl;
apiConfig.apiToken = apiToken;
apiConfig.apiSession = apiSession;
console.log("Inside the function api_url :"+apiUrl+" api_token : "+apiToken+"--- sessiontoken : "+apiSession);
}
bootstrap(AppComponent, [
provide("api.config", {useValue: apiConfig})
]);
platformBrowserDynamic().bootstrapModule(AppModule);
But i am not able to import
bootstrap(AppComponent, [
provide("api.config", {useValue: apiConfig})
]);
Its not in my @angular package.
My Issue is:
I want to pass accesstoken and sessiontoken to angular app. In the first component (App Component) i want to check (by server api) if user is authorised to access the app.
Metadata
Metadata
Assignees
Labels
No labels