2015-11-05 07:33:56 -05:00
@cheatsheetSection
2015-11-06 07:26:24 -05:00
Bootstrapping
@cheatsheetIndex 0
2015-11-05 07:33:56 -05:00
@description
2016-08-08 20:18:50 -04:00
{@target ts}`import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';`{@endtarget}
2016-08-08 20:25:42 -04:00
{@target js}Available from the `ng.platformBrowserDynamic` namespace{@endtarget}
2015-11-05 07:33:56 -05:00
@cheatsheetItem
2016-08-30 11:32:51 -04:00
syntax(ts):
`platformBrowserDynamic().bootstrapModule(AppModule);` |`platformBrowserDynamic().bootstrapModule`
2015-12-12 22:17:26 -05:00
syntax(js):
2016-08-08 20:25:42 -04:00
`document.addEventListener('DOMContentLoaded', function() {
ng.platformBrowserDynamic
.platformBrowserDynamic()
.bootstrapModule(app.AppModule);
});`|`platformBrowserDynamic().bootstrapModule`
2015-12-09 07:33:42 -05:00
description:
2016-08-30 11:32:51 -04:00
Bootstraps the app, using the root component from the specified `NgModule` . {@target js}Must be wrapped in the event listener to fire when the page loads.{@endtarget}