Skip to content

GET http://localhost:4200/app/main.ts 404 (Not Found) #11

@amitkaira87

Description

@amitkaira87

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions