import { NgModule } from '@angular/core';
import { CommonModule as NgCommonModule, APP_BASE_HREF } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';

import { RuntimeBaseModule, CanDeactivateNgPageGuard } from '@wm/runtime/base';
{{WMComponentsImportStmts requiredWMComponents}}

import { AppCodeGenModule } from '../../app-codegen.module';

{{PartialModuleImportStmts requiredPartials}}

import { {{componentName}} } from './{{name}}.component';

const components = [{{componentName}}];

const routes: Routes = [
    {
        path: '',
        component: {{componentName}},
        canDeactivate: [CanDeactivateNgPageGuard]
    }
];

const requiredComponentModules = [
    {{WMComponentModuleStmts requiredWMComponents}}
];

const requiredPartialModules: any[] = [
    {{PartialModuleStmts requiredPartials}}
];

@NgModule({
    declarations: components,
    imports: [
        ...requiredComponentModules,
        ...requiredPartialModules,
        RouterModule.forChild(routes),
        NgCommonModule,
        AppCodeGenModule,
        RuntimeBaseModule
    ],
    {{#if hasCustomElement}}
    schemas: [CUSTOM_ELEMENTS_SCHEMA],
    {{/if}}
    exports: components
})
export class {{moduleName}} {

}

