123456789101112131415161718192021222324252627282930313233343536373839 |
- import { BrowserModule } from '@angular/platform-browser';
- import { NgModule } from '@angular/core';
- import { CommonModule } from '@angular/common';
- import { AppRoutingModule } from './app-routing.module';
- import { AppComponent } from './app.component';
- import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
- import { registerLocaleData, HashLocationStrategy, LocationStrategy } from '@angular/common';
- import zh from '@angular/common/locales/zh';
- import { HttpInterceptorService } from './services/httpInterceptor.service';//请求拦截器
- import { ShareModule } from './share/share.module';
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
- import { NZ_I18N, zh_CN, NzConfig, NZ_CONFIG } from 'ng-zorro-antd';
- const ngZorroConfig: NzConfig = {
- // 注意组件名称没有 nz 前缀
- notification: { nzTop: 100 }
- };
- registerLocaleData(zh);
- @NgModule({
- declarations: [
- AppComponent,
- ],
- imports: [
- BrowserModule,
- CommonModule,
- BrowserAnimationsModule,
- AppRoutingModule,
- HttpClientModule,
- ShareModule,
- ],
- providers: [
- { provide: NZ_I18N, useValue: zh_CN },
- { provide: NZ_CONFIG, useValue: ngZorroConfig },
- { provide: LocationStrategy, useClass: HashLocationStrategy },
- { provide: HTTP_INTERCEPTORS, useClass: HttpInterceptorService, multi: true },
- ],
- bootstrap: [AppComponent]
- })
- export class AppModule { }
|