Browse Source

Update Angular component replacement example

pull/23275/head
Fahri Gedik 1 year ago
parent
commit
600a47776c
  1. 18
      docs/en/ui-themes/lepton-x/angular-customization.md

18
docs/en/ui-themes/lepton-x/angular-customization.md

@ -18,14 +18,18 @@ The **Layout components** and all the replacable components are predefined in `e
### How to replace a component ### How to replace a component
```js ```js
import { ReplaceableComponentsService } from '@abp/ng.core'; // imported ReplaceableComponentsService import { Component, inject } from '@angular/core';
import {eThemeLeptonXComponents} from "@volosoft/abp.ng.theme.lepton-x"; // imported eThemeLeptonXComponents enum import { ReplaceableComponentsService } from '@abp/ng.core';
//... import { eThemeLeptonXComponents } from '@volosoft/abp.ng.theme.lepton-x';
@Component(/* component metadata */) import { YourNewApplicationLayoutComponent } from './your-new-application-layout.component'; // varsa
@Component({
// component metadata
})
export class AppComponent { export class AppComponent {
constructor( private readonly replaceableComponents = inject(ReplaceableComponentsService);
private replaceableComponents: ReplaceableComponentsService, // injected the service
) { constructor() {
this.replaceableComponents.add({ this.replaceableComponents.add({
component: YourNewApplicationLayoutComponent, component: YourNewApplicationLayoutComponent,
key: eThemeLeptonXComponents.ApplicationLayout, key: eThemeLeptonXComponents.ApplicationLayout,

Loading…
Cancel
Save