Main.ts
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule} from '@angular/http';
import { AppComponent } from './app.component';
//service
import { DataService } from './shared/data.service';
@NgModule({
imports: [ BrowserModule, FormsModule, HttpModule],
declarations: [ AppComponent ],
providers: [ DataService],
bootstrap: [ AppComponent ]
})
export class AppModule {}
starting point
<script>
var temp = "Prafulla";
System.import('app').catch(function (err) { console.error(err); });
</script>
I want to use temp variable inside angular2
I tried using this link Here but not work I donot understand how and where to write main function my app.module.ts
how to do it?