UNPKG

@nstudio/schematics

Version:

Cross-platform (xplat) tools for Nx workspaces.

28 lines (26 loc) 1.26 kB
import { NgModule } from '@angular/core';<% if (!onlyModule && onlyProject && routing) { %> import { RouterModule, Routes } from '@angular/router';<% } %> <% if (!onlyProject) { %>import { <%= utils.classify(name) %>Module as Shared<%= utils.classify(name) %>Module } from '@<%= npmScope %>/features';<% } if (onlyProject) { %> import { SharedModule } from '../shared/shared.module';<% } else { %> import { UIModule } from '../ui/ui.module';<% } if (!onlyModule) { %> import { <%= utils.sanitize(name).toUpperCase() %>_COMPONENTS<% if (onlyProject && routing) { %>, <%= utils.classify(name) %>Component<% } %> } from './components'; <% if (onlyProject && routing) { %> export const routes: Routes = [ { path: '', component: <%= utils.classify(name) %>Component } ];<% } } %> @NgModule({ imports: [ <% if (!onlyProject) { %>Shared<%= utils.classify(name) %>Module,<% } if (onlyProject) { %>SharedModule<% if (routing) { %>, RouterModule.forChild(routes)<% } } else { %>UIModule<% } %> ],<% if (!onlyModule) { %> declarations: [ ...<%= utils.sanitize(name).toUpperCase() %>_COMPONENTS ], exports: [ ...<%= utils.sanitize(name).toUpperCase() %>_COMPONENTS ]<% } %> }) export class <%= utils.classify(name) %>Module {}