mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 23:40:14 +01:00
refactor(app): refactor forRoot & menu import
This commit is contained in:
parent
d6cef06dcd
commit
be69ccc058
6 changed files with 170 additions and 111 deletions
|
|
@ -1,8 +1,9 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import {
|
||||
NgaThemeModule,
|
||||
NgaCardModule,
|
||||
NgaLayoutModule,
|
||||
NgaTabsetModule,
|
||||
|
|
@ -45,6 +46,7 @@ const NGA_MODULES = [
|
|||
NgaUserModule,
|
||||
NgaActionsModule,
|
||||
NgaSearchModule,
|
||||
NgaSidebarModule,
|
||||
];
|
||||
|
||||
const COMPONENTS = [
|
||||
|
|
@ -61,11 +63,17 @@ const PIPES = [
|
|||
RoundPipe,
|
||||
];
|
||||
|
||||
const NGA_THEME_PROVIDERS = [
|
||||
...NgaThemeModule.forRoot({ name: 'cosmic' }).providers,
|
||||
...NgaSidebarModule.forRoot().providers,
|
||||
...NgaSidebarModule.forRoot().providers,
|
||||
...NgaMenuModule.forRoot().providers,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
...BASE_MODULES,
|
||||
...NGA_MODULES,
|
||||
NgaSidebarModule.forRoot(),
|
||||
],
|
||||
exports: [
|
||||
...BASE_MODULES,
|
||||
|
|
@ -79,4 +87,13 @@ const PIPES = [
|
|||
],
|
||||
})
|
||||
export class ThemeModule {
|
||||
|
||||
static forRoot(): ModuleWithProviders {
|
||||
return <ModuleWithProviders>{
|
||||
ngModule: ThemeModule,
|
||||
providers: [
|
||||
...NGA_THEME_PROVIDERS,
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue