ngx-admin/src/app/@theme/theme.module.ts

100 lines
1.7 KiB
TypeScript
Raw Normal View History

import { ModuleWithProviders, NgModule } from '@angular/core';
2017-04-13 14:24:23 +03:00
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import {
NgaThemeModule,
2017-04-13 14:24:23 +03:00
NgaCardModule,
NgaLayoutModule,
NgaTabsetModule,
NgaRouteTabsetModule,
NgaSidebarModule,
NgaMenuModule,
NgaUserModule,
NgaActionsModule,
NgaSearchModule,
} from '@akveo/nga-theme';
2017-04-13 14:24:23 +03:00
import {
HeaderComponent,
FooterComponent,
SearchInputComponent,
2017-05-06 15:35:15 +03:00
TinyMCEComponent,
} from './components';
import {
CapitalizePipe,
PluralPipe,
RoundPipe,
} from './pipes';
import { OneColumnLayoutComponent } from './layouts';
2017-04-13 14:24:23 +03:00
const BASE_MODULES = [
CommonModule,
FormsModule,
ReactiveFormsModule,
2017-04-13 14:24:23 +03:00
];
const NGA_MODULES = [
NgaCardModule,
NgaLayoutModule,
NgaTabsetModule,
NgaRouteTabsetModule,
NgaMenuModule,
NgaUserModule,
NgaActionsModule,
NgaSearchModule,
NgaSidebarModule,
2017-04-13 14:24:23 +03:00
];
const COMPONENTS = [
2017-04-28 15:14:05 +03:00
HeaderComponent,
FooterComponent,
SearchInputComponent,
TinyMCEComponent,
OneColumnLayoutComponent,
2017-04-13 14:24:23 +03:00
];
const PIPES = [
CapitalizePipe,
PluralPipe,
RoundPipe,
];
const NGA_THEME_PROVIDERS = [
...NgaThemeModule.forRoot({ name: 'cosmic' }).providers,
...NgaSidebarModule.forRoot().providers,
...NgaSidebarModule.forRoot().providers,
...NgaMenuModule.forRoot().providers,
];
2017-04-13 14:24:23 +03:00
@NgModule({
imports: [
...BASE_MODULES,
...NGA_MODULES,
],
exports: [
...BASE_MODULES,
...NGA_MODULES,
...COMPONENTS,
...PIPES,
2017-04-13 14:24:23 +03:00
],
declarations: [
...COMPONENTS,
...PIPES,
],
2017-04-13 14:24:23 +03:00
})
export class ThemeModule {
static forRoot(): ModuleWithProviders {
return <ModuleWithProviders>{
ngModule: ThemeModule,
providers: [
...NGA_THEME_PROVIDERS,
],
};
}
2017-04-13 14:24:23 +03:00
}