Tutorial by Examples

import { NgModule } from '@angular/core'; @NgModule({ declarations: [], // components your module owns. imports: [], // other modules your module needs. providers: [], // providers available to your module. bootstrap: [] // bootstrap this root component. }) export class MyModule {} ...
// app.module.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { HttpModule } from '@angular/http'; import { MyRootComponent } from './app.component'; @NgModule({ declarations: [MyRootComponent], imports: [BrowserModule, Ht...
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { MyModule } from './app.module'; platformBrowserDynamic().bootstrapModule( MyModule ); In this example, MyModule is the module containing your root component. By bootstrapping MyModule your Angul...
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @NgModule({ imports: [ BrowserModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModul...
We can statically bootstrap an application by taking the plain ES5 Javascript output of the generated factory classes. Then we can use that output to bootstrap the application: import { platformBrowser } from '@angular/platform-browser'; import { AppModuleNgFactory } from './main.ngfactory'; //...

Page 1 of 1