I am learning angular 2 through the book I just bought (become a ninja with angular 2).
I also look through the official document in parallel, but when you make a quick start from the official site, I see what they are talking about @NgModule, although this is not mentioned in the book.
So, I would like to know if the white paper is up to date, and whether NgModule is really a new thing. It seems that I read somewhere that the document was not up to date, so I would not want to use something that will soon become obsolete.
Here's how they load the application into a book:
import { bootstrap } from '@angular/platform-browser-dynamic';
import PonyRacerAppComponent from './app/ponyracer-app.component';
bootstrap(PonyRacerAppComponent).catch(err => console.log(err));
And this is how they download the app in the official quick launch:
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 AppModule { }
then in another file:
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
source
share