From b2eab977d97aac1972f43e3bf1dc69e75a6cb57c Mon Sep 17 00:00:00 2001 From: Andrew Kushnir Date: Tue, 25 May 2021 12:06:31 -0700 Subject: [PATCH] docs: remove `entryComponents` references from the custom elements guide (#42324) Since `entryComponents` field is deprecated and no longer used in Ivy, this commit removes `entryComponents` references from the custom elements guide. Closes #40341. PR Close #42324 --- aio/content/examples/elements/src/app/app.module.ts | 5 ----- aio/content/guide/elements.md | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/aio/content/examples/elements/src/app/app.module.ts b/aio/content/examples/elements/src/app/app.module.ts index f273e77b14..a56491dc25 100644 --- a/aio/content/examples/elements/src/app/app.module.ts +++ b/aio/content/examples/elements/src/app/app.module.ts @@ -6,16 +6,11 @@ import { AppComponent } from './app.component'; 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. - @NgModule({ imports: [BrowserModule, BrowserAnimationsModule], providers: [PopupService], declarations: [AppComponent, PopupComponent], bootstrap: [AppComponent], - entryComponents: [PopupComponent], }) export class AppModule { } diff --git a/aio/content/guide/elements.md b/aio/content/guide/elements.md index d495e29469..70c55a5c69 100644 --- a/aio/content/guide/elements.md +++ b/aio/content/guide/elements.md @@ -147,9 +147,9 @@ Using an Angular custom element makes the process much simpler and more transpar The Popup Service example application (shown below) defines a component that you can either load dynamically or convert to a custom element. - `popup.component.ts` defines a simple pop-up element that displays an input message, with some animation and styling. -- `popup.service.ts` creates an injectable service that provides two different ways to invoke the PopupComponent; as a dynamic component, or as a custom element. Notice how much more setup is required for the dynamic-loading method. -- `app.module.ts` adds the PopupComponent in the module's `entryComponents` list, to exclude it from compilation and avoid startup warnings or errors. -- `app.component.ts` defines the application's root component, which uses the PopupService to add the pop-up to the DOM at run time. When the application runs, the root component's constructor converts PopupComponent to a custom element. +- `popup.service.ts` creates an injectable service that provides two different ways to invoke the `PopupComponent`; as a dynamic component, or as a custom element. Notice how much more setup is required for the dynamic-loading method. +- `app.module.ts` adds the `PopupComponent` in the module's `declarations` list. +- `app.component.ts` defines the application's root component, which uses the `PopupService` to add the pop-up to the DOM at run time. When the application runs, the root component's constructor converts `PopupComponent` to a custom element. For comparison, the demo shows both methods. One button adds the popup using the dynamic-loading method, and the other uses the custom element. You can see that the result is the same; only the preparation is different.