From 2c04a5b5ad1ecd6d463bfb528091a67c319414bf Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Thu, 10 Sep 2020 10:52:37 +0300 Subject: [PATCH] docs: update the Component-Replacement.md --- docs/en/UI/Angular/Component-Replacement.md | 38 +++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/docs/en/UI/Angular/Component-Replacement.md b/docs/en/UI/Angular/Component-Replacement.md index d79a67829c..577129e139 100644 --- a/docs/en/UI/Angular/Component-Replacement.md +++ b/docs/en/UI/Angular/Component-Replacement.md @@ -145,9 +145,7 @@ The final UI looks like below: Run the following command in `angular` folder to create a new component called `RoutesComponent`. ```bash -yarn ng generate component routes --entryComponent - -# You don't need the --entryComponent option in Angular 9 +yarn ng generate component routes ``` Open the generated `routes.component.ts` in `src/app/routes` folder and replace its content with the following: @@ -187,6 +185,21 @@ export class RoutesComponent implements AfterViewInit { } ``` +Import the `SharedModule` to the `imports` array of `AppModule`: + +```js +// app.module.ts + +import { SharedModule } from './shared/shared.module'; + +@NgModule({ + imports: [ + //... + SharedModule + ] +)} +``` + Open the generated `routes.component.html` in `src/app/routes` folder and replace its content with the following: ```html @@ -327,9 +340,7 @@ The final UI looks like below: Run the following command in `angular` folder to create a new component called `NavItemsComponent`. ```bash -yarn ng generate component nav-items --entryComponent - -# You don't need the --entryComponent option in Angular 9 +yarn ng generate component nav-items ``` Open the generated `nav-items.component.ts` in `src/app/nav-items` folder and replace the content with the following: @@ -414,6 +425,21 @@ export class NavItemsComponent implements AfterViewInit { } ``` +Import the `SharedModule` to the `imports` array of `AppModule`: + +```js +// app.module.ts + +import { SharedModule } from './shared/shared.module'; + +@NgModule({ + imports: [ + //... + SharedModule + ] +)} +``` + Open the generated `nav-items.component.html` in `src/app/nav-items` folder and replace the content with the following: ```html