Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* 进一步对基础模块的导入提炼
* 有关模块注册指导原则请参考:https://github.com/ng-alain/ng-alain/issues/180
*/
import { NgModule, Optional, SkipSelf, ModuleWithProviders } from '@angular/core';
import { throwIfAlreadyLoaded } from '@core';
import { AlainThemeModule } from '@delon/theme';
// #region mock
import { DelonMockModule } from '@delon/mock';
import * as MOCKDATA from '../../_mock';
import { environment } from '@env/environment';
const MOCK_MODULES = !environment.production
? [DelonMockModule.forRoot({ data: MOCKDATA })]
: [];
// #endregion
// #region reuse-tab
/**
* 若需要[路由复用](https://ng-alain.com/components/reuse-tab)需要:
* 1、增加 `REUSETAB_PROVIDES`
* 2、在 `src/app/layout/default/default.component.html` 修改:
* ```html
* <section class="alain-default__content">
*
*
* </section>
* ```
*/
import { RouteReuseStrategy } from '@angular/router';
/**
* 进一步对基础模块的导入提炼
* 有关模块注册指导原则请参考:https://ng-alain.com/docs/module
*/
import { NgModule, Optional, SkipSelf, ModuleWithProviders } from '@angular/core';
import { throwIfAlreadyLoaded } from '@core';
import { AlainThemeModule } from '@delon/theme';
// #region mock
import { DelonMockModule } from '@delon/mock';
import * as MOCKDATA from '../../_mock';
import { environment } from '@env/environment';
const MOCK_MODULES = true ? [DelonMockModule.forRoot({ data: MOCKDATA })] : [];
// #endregion
// #region reuse-tab
/**
* 若需要[路由复用](https://ng-alain.com/components/reuse-tab)需要:
* 1、增加 `REUSETAB_PROVIDES`
* 2、在 `src/app/layout/default/default.component.html` 修改:
* ```html
* <section class="alain-default__content">
*
*
* </section>
* ```
*/
import { RouteReuseStrategy } from '@angular/router';
import { ReuseTabService, ReuseTabStrategy } from '@delon/abc/reuse-tab';
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 }],
};
}
/**
* 进一步对基础模块的导入提炼
* 有关模块注册指导原则请参考:https://github.com/ng-alain/ng-alain/issues/180
*/
import { NgModule, Optional, SkipSelf, ModuleWithProviders } from '@angular/core';
import { throwIfAlreadyLoaded } from '@core';
import { AlainThemeModule } from '@delon/theme';
// #region mock
import { DelonMockModule } from '@delon/mock';
import * as MOCKDATA from '../../_mock';
import { environment } from '@env/environment';
const MOCK_MODULES = !environment.production
? [DelonMockModule.forRoot({ data: MOCKDATA })]
: [];
// #endregion
// #region reuse-tab
/**
* 若需要[路由复用](https://ng-alain.com/components/reuse-tab)需要:
* 1、增加 `REUSETAB_PROVIDES`
* 2、在 `src/app/layout/default/default.component.html` 修改:
* ```html
* <section class="alain-default__content">
*
*
* </section>
* ```
*/
import { RouteReuseStrategy } from '@angular/router';
/**
* 进一步对基础模块的导入提炼
* 有关模块注册指导原则请参考:https://ng-alain.com/docs/module
*/
import { NgModule, Optional, SkipSelf, ModuleWithProviders } from '@angular/core';
import { throwIfAlreadyLoaded } from '@core';
import { AlainThemeModule } from '@delon/theme';
// #region mock
import { DelonMockModule } from '@delon/mock';
import * as MOCKDATA from '../../_mock';
import { environment } from '@env/environment';
const MOCK_MODULES = true ? [DelonMockModule.forRoot({ data: MOCKDATA })] : [];
// #endregion
// #region reuse-tab
/**
* 若需要[路由复用](https://ng-alain.com/components/reuse-tab)需要:
* 1、增加 `REUSETAB_PROVIDES`
* 2、在 `src/app/layout/default/default.component.html` 修改:
* ```html
* <section class="alain-default__content">
*
*
* </section>
* ```
*/
import { RouteReuseStrategy } from '@angular/router';
import { ReuseTabService, ReuseTabStrategy } from '@delon/abc/reuse-tab';
'/api/403': () => { throw new MockStatusError(403); },
'/api/404': () => { throw new MockStatusError(404); },
'/404': () => { throw new MockStatusError(404); }
};
'/404': () => {
throw new MockStatusError(404);
},
};
'/api/401': () => { throw new MockStatusError(401); },
'/api/403': () => { throw new MockStatusError(403); },
'/500': () => {
throw new MockStatusError(500);
},
'/404': () => {