Using ng-zorro-antd UI Components With the ABP Framework

774 views Asked by At
1

There are 1 answers

2
Kishore Sahasranaman On BEST ANSWER
  1. Add ng-zorro-antd

    yarn add ng-zorro-antd

  2. Add required modules to shared.module.ts

import { CoreModule } from '@abp/ng.core';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
import { NgModule } from '@angular/core';
import { ThemeBasicModule } from '@abp/ng.theme.basic';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { NzLayoutModule } from 'ng-zorro-antd/layout'; //add this line

@NgModule({
  declarations: [],
  imports: [
    CoreModule,
    ThemeSharedModule,
    ThemeBasicModule,
    NgbDropdownModule,
    NgxValidateCoreModule,
    NzLayoutModule //add this line
  ],
  exports: [
    CoreModule,
    ThemeSharedModule,
    ThemeBasicModule,
    NgbDropdownModule,
    NgxValidateCoreModule,
    NzLayoutModule //add this line
  ],
  providers: []
})
export class SharedModule {}

  1. Follow the instructions from

https://docs.abp.io/en/abp/latest/UI/Angular/Component-Replacement#how-to-replace-a-layout

  1. Go to \src\app\my-layout\my-layout.component.html and add the below code.

  <nz-layout>
    <nz-header>Header</nz-header>
    <nz-content>
        <router-outlet></router-outlet>
    </nz-content>
    <nz-footer>Footer</nz-footer>
</nz-layout>