Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @NgModule({
- declarations: [
- AppComponent
- ],
- imports: [
- BrowserModule,
- AppRoutingModule
- ],
- providers: [],
- entryComponents: [AppComponent]
- // bootstrap: [AppComponent]
- })
- export class AppModule {
- ngDoBootstrap(app: ApplicationRef) {
- // obtain reference to the DOM element that shows status
- // and change the status to `Loaded`
- const dynamicComponentElement = document.querySelector('#sidebar');
- dynamicComponentElement.textContent = 'Loaded';
- // create DOM element for the component being bootstrapped
- // and add it to the DOM
- const componentElement = document.createElement('app-root');
- document.body.appendChild(componentElement);
- // bootstrap the application with the component
- app.bootstrap(AppComponent);
- }
- }
- platformBrowserDynamic().bootstrapModule(AppModule).then(ref => {
- // Ensure Angular destroys itself on hot reloads.
- if (window['ngRef']) {
- window['ngRef'].destroy();
- }
- window['ngRef'] = ref;
- // Otherise, log the boot error
- }).catch(err => console.error(err));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement