Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save bisubus/fbef01fdb3b14e7349aead9b00701260 to your computer and use it in GitHub Desktop.

Select an option

Save bisubus/fbef01fdb3b14e7349aead9b00701260 to your computer and use it in GitHub Desktop.
import { Inject, ApplicationRef } from '@angular/core';
import { DOCUMENT } from '@angular/common';
@NgModule({
imports: [BrowserModule],
declarations: [App, Bpp],
entryComponents: [App, Bpp]
})
export class AppModule {
constructor(@Inject(DOCUMENT) private _document: any) {}
ngDoBootstrap(applicationRef: ApplicationRef) {
const document = this._document;
if (document.querySelector('app')) {
applicationRef.bootstrap(App);
}
if (document.querySelector('bpp')) {
applicationRef.bootstrap(Bpp);
}
}
}
@glenatron
Copy link
Copy Markdown

This was very useful but things have changed a little in Angular 8 - I got it working as described in the answer to this SO question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment