This article describes the bootstrap
function used to bootstrap angular app:
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app.component';
bootstrap(AppComponent)
.then(success => console.log('Bootstrap successfully!'))
.catch(err => console.log(err));
However, I'm bootstrapping the app like this:
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
What's the difference?
Since 2.0.0-rc.5 (2016-08-09) there is no longer the bootstrap
function.
You need to use platformBrowserDynamic().bootstrapModule
instead.
More about it you can read at changelog page
https://github.com/angular/angular/blob/master/CHANGELOG.md#200-rc5-2016-08-09
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With