diff --git a/aio/content/examples/elements/src/app/app.component.ts b/aio/content/examples/elements/src/app/app.component.ts index 092a8c8ba2..2ef51e0ebe 100644 --- a/aio/content/examples/elements/src/app/app.component.ts +++ b/aio/content/examples/elements/src/app/app.component.ts @@ -8,19 +8,15 @@ import { PopupComponent } from './popup.component'; selector: 'app-root', template: ` - - - ` + + + `, }) - export class AppComponent { - constructor(private injector: Injector, public popup: PopupService) { - // on init, convert PopupComponent to a custom element - const PopupElement = -createNgElementConstructor(PopupComponent, {injector: this.injector}); - // register the custom element with the browser. - customElements.define('popup-element', PopupElement); + constructor(injector: Injector, public popup: PopupService) { + // Convert `PopupComponent` to a custom element. + const PopupElement = createNgElementConstructor(PopupComponent, {injector}); + // Register the custom element with the browser. + customElements.define('popup-element', PopupElement); } } diff --git a/aio/content/examples/elements/src/app/app.module.ts b/aio/content/examples/elements/src/app/app.module.ts index 0c2eec1938..3b78fa6951 100644 --- a/aio/content/examples/elements/src/app/app.module.ts +++ b/aio/content/examples/elements/src/app/app.module.ts @@ -1,22 +1,22 @@ // #docregion +import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; -import { PopupService } from './popup.service'; import { PopupComponent } from './popup.component'; +import { PopupService } from './popup.service'; -// include the PopupService provider, -// but exclude PopupComponent from compilation, -// because it will be added dynamically +// Include the `PopupService` provider, +// but exclude `PopupComponent` from compilation, +// because it will be added dynamically. @NgModule({ - declarations: [AppComponent, PopupComponent], imports: [BrowserModule, BrowserAnimationsModule], providers: [PopupService], + declarations: [AppComponent, PopupComponent], bootstrap: [AppComponent], entryComponents: [PopupComponent], }) - -export class AppModule {} +export class AppModule { +}