Skip to content

Commit

Permalink
docs: remove entryComponents references from the custom elements gu…
Browse files Browse the repository at this point in the history
…ide (#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
  • Loading branch information
AndrewKushnir authored and umairhm committed May 28, 2021
1 parent d08e3a2 commit 08788f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions aio/content/examples/elements/src/app/app.module.ts
Expand Up @@ -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 {
}
6 changes: 3 additions & 3 deletions aio/content/guide/elements.md
Expand Up @@ -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.

Expand Down

0 comments on commit 08788f3

Please sign in to comment.