Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
modal: { size: 'lg' },
};
}
const GLOBAL_CONFIG_PROVIDES = [
// TIPS:@delon/abc 有大量的全局配置信息,例如设置所有 `st` 的页码默认为 `20` 行
{ provide: STConfig, useFactory: fnSTConfig },
{ provide: PageHeaderConfig, useFactory: fnPageHeaderConfig },
{ provide: DelonAuthConfig, useFactory: fnDelonAuthConfig },
{ provide: DelonACLConfig, useFactory: fnDelonACLConfig },
];
// #endregion
@NgModule({
imports: [AlainThemeModule.forRoot(), DelonACLModule.forRoot(), ...MOCK_MODULES],
})
export class DelonModule {
constructor(@Optional() @SkipSelf() parentModule: DelonModule) {
throwIfAlreadyLoaded(parentModule, 'DelonModule');
}
static forRoot(): ModuleWithProviders {
return {
ngModule: DelonModule,
providers: [...REUSETAB_PROVIDES, ...GLOBAL_CONFIG_PROVIDES],
};
}
}
modal: { size: 'lg' },
};
}
const GLOBAL_CONFIG_PROVIDES = [
// TIPS:@delon/abc 有大量的全局配置信息,例如设置所有 `st` 的页码默认为 `20` 行
{ provide: STConfig, useFactory: fnSTConfig },
{ provide: PageHeaderConfig, useFactory: fnPageHeaderConfig },
{ provide: DelonAuthConfig, useFactory: fnDelonAuthConfig },
{ provide: DelonACLConfig, useFactory: fnDelonACLConfig },
];
// #endregion
@NgModule({
imports: [AlainThemeModule.forRoot(), DelonACLModule.forRoot(), ...MOCK_MODULES],
})
export class DelonModule {
constructor(@Optional() @SkipSelf() parentModule: DelonModule) {
throwIfAlreadyLoaded(parentModule, 'DelonModule');
}
static forRoot(): ModuleWithProviders {
return {
ngModule: DelonModule,
providers: [...REUSETAB_PROVIDES, ...GLOBAL_CONFIG_PROVIDES],
};
}
}
return Object.assign(new STConfig(), {
ps: 3,
});
}
export function fnLodopConfig(): LodopConfig {
return Object.assign(new LodopConfig(), {
license: `A59B099A586B3851E0F0D7FDBF37B603`,
licenseA: `C94CEE276DB2187AE6B65D56B3FC2848`,
});
}
// #endregion
@NgModule({
imports: [AlainThemeModule.forRoot(), DelonFormModule.forRoot(), DelonACLModule.forRoot(), DelonMockModule.forRoot({ data: MOCKDATA })],
})
export class DelonModule {
constructor(
@Optional()
@SkipSelf()
parentModule: DelonModule,
) {
throwIfAlreadyLoaded(parentModule, 'DelonModule');
}
static forRoot(): ModuleWithProviders {
return {
ngModule: DelonModule,
providers: [...REUSETAB_PROVIDES, { provide: STConfig, useFactory: fnSTConfig }, { provide: LodopConfig, useFactory: fnLodopConfig }],
};
}
import { DelonACLModule } from '@delon/acl';
registerLocaleData(zh);
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
CoreModule,
LayoutModule,
RoutesModule,
SharedModule,
HttpClientModule,
DelonAuthModule.forRoot(),
DelonACLModule.forRoot(),
BrowserAnimationsModule,
],
providers: [
{ provide: HTTP_INTERCEPTORS, useClass: SimpleInterceptor, multi: true },
{ provide: NZ_NOTIFICATION_CONFIG, useValue: { nzMaxStack: 1 } },
{ provide: NZ_I18N, useValue: zh_CN },
ApiService,
{
provide: API_URL,
useValue: environment.urlPrefix
}
],
bootstrap: [AppComponent]
})
export class AppModule { }
configureTestSuite(() => {
const imports = [NoopAnimationsModule, DelonFormModule.forRoot()];
if (options.i18n) {
imports.push(AlainThemeModule.forRoot());
}
if (options.acl) {
imports.push(DelonACLModule.forRoot());
}
injector = TestBed.configureTestingModule({
imports,
declarations: [TestFormComponent, TestModeComponent],
});
});
}