diff --git a/docs/en/UI/Angular/Page-Component.md b/docs/en/UI/Angular/Page-Component.md index 3c9e557176..a9e9857142 100644 --- a/docs/en/UI/Angular/Page-Component.md +++ b/docs/en/UI/Angular/Page-Component.md @@ -4,14 +4,14 @@ ABP provides a component that wraps your content with some built-in components t If the template of a component looks as follows, you can utilize the `abp-page` component. -E.g. +Let's look at the following example without `abp-page` component. -`app.component.ts` +`dashboard.component.ts` ```html
-

{{ '::AppTitle' | abpLocalization }}

+

{{ '::Dashboard' | abpLocalization }}

-
- +
+
``` @@ -36,30 +36,32 @@ export enum PageParts { breadcrumb = 'PageBreadcrumbContainerComponent', toolbar = 'PageToolbarContainerComponent', } + +// You can import this enum from -> import { PageParts } from '@abp/ng.components/page'; ``` ## Usage Firstly, you need to import `PageModule` from `@abp/ng.components/page` as follows: -`app.module.ts` +`dashboard.module.ts` ```javascript import { PageModule } from '@abp/ng.components/page'; -import { AppComponent } from './app.component'; +import { DashboardComponent } from './dashboard.component'; @NgModule({ - declarations: [AppComponent], + declarations: [DashboardComponent], imports: [PageModule] }) -export class AppModule {} +export class DashboardModule {} ``` -And change the template of `app.component.ts` to the following: +And change the template of `dashboard.component.ts` to the following: ```html - -
+ +
@@ -150,6 +152,7 @@ import {  PageParts, PAGE_RENDER_STRATEGY } from '@abp/ng.components/page'; + @Injectable() export class MyPageRenderStrategy implements PageRenderStrategy { shouldRender(type: string) { @@ -182,24 +185,24 @@ export class MyPageRenderStrategy implements PageRenderStrategy { } @Component({ - selector: 'app-root', + selector: 'app-dashboard', template: ` - + - + -
+

Inner Title

` }) -export class AppComponent {} +export class DashboardComponent {} @NgModule({ imports: [PageModule], - declarations: [AppComponent], + declarations: [DashboardComponent], providers: [ { provide: PAGE_RENDER_STRATEGY, @@ -207,7 +210,7 @@ export class AppComponent {} } ] }) -export class AppModule {} +export class DashboardModule {} ``` ## See Also