@hicoder/angular-cli
Version:
Angular UI componenets and service generator. It works with the mean-rest-express package to generate the end to end web application. The input to this generator is the Mongoose schema defined for the express application. mean-rest-express exposes the Res
110 lines (107 loc) • 5.91 kB
text/typescript
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
<%for (let imp in mImports.imports) {
let components = mImports.imports[imp];%>
import { <% for (let c of components) {%><%-c%>,<%}%> } from '<%-imp%>';
<%}%>
import { <%-ModuleName%>RoutingCoreModule } from './<%-moduleName%>-routing.core.module';
import { <%-ModuleName%>Component } from './<%-moduleName%>.component';
// Import components for each schema
<%_
for (let sch_name in schemaMap) { let schm = schemaMap[sch_name]; let api = schm.api;%>
import { <%-schm.SchemaName%>Component } from './<%-schm.schemaName%>/<%-schm.schemaName%>.component';<%_
if (api.includes("L")) {%>
import { <%-schm.SchemaName%>ListComponent } from './<%-schm.schemaName%>/<%-schm.schemaName%>-list/<%-schm.schemaName%>-list.component';
import { <%-schm.SchemaName%>ListViewComponent } from './<%-schm.schemaName%>/<%-schm.schemaName%>-list/<%-schm.schemaName%>-list-view.component';
import { <%-schm.SchemaName%>ListCustComponent } from '../<%-moduleName%>-cust/base/<%-schm.schemaName%>/<%-schm.schemaName%>-list.cust.component';<%_ } %><%_
if (api.includes('L')) { for (const [fileName, CompName] of schm.knownListWidgets) {%>
import { <%-schm.SchemaName%><%-CompName%>Component } from './<%-schm.schemaName%>/<%-schm.schemaName%>-list/<%-schm.schemaName%>-<%-fileName%>.component';<%}
for (const [fileName, CompName] of schm.knownListViewWidgets) {%>
import { <%-schm.SchemaName%><%-CompName%>Component } from './<%-schm.schemaName%>/<%-schm.schemaName%>-list/<%-schm.schemaName%>-<%-fileName%>.component';<%}
}%><%_
if (api.includes("R")) {%>
import { <%-schm.SchemaName%>DetailComponent } from './<%-schm.schemaName%>/<%-schm.schemaName%>-detail/<%-schm.schemaName%>-detail.component';
import { <%-schm.SchemaName%>DetailCustComponent } from '../<%-moduleName%>-cust/base/<%-schm.schemaName%>/<%-schm.schemaName%>-detail.cust.component';<%_
} %><%_
if (api.includes('R')) { for (const [fileName, CompName] of schm.knownDetailWidgets) {%>
import { <%-schm.SchemaName%><%-CompName%>Component } from './<%-schm.schemaName%>/<%-schm.schemaName%>-detail/<%-schm.schemaName%>-<%-fileName%>.component';<%}
}%><%_
if (api.includes("R") || api.includes('L')) {%>
import { <%-schm.SchemaName%>DetailFieldComponent } from './<%-schm.schemaName%>/<%-schm.schemaName%>-detail/<%-schm.schemaName%>-detail-field.component';<%_
} %><%_
if (api.includes("U") || api.includes("C")) {%>
import { <%-schm.SchemaName%>EditComponent } from './<%-schm.schemaName%>/<%-schm.schemaName%>-edit/<%-schm.schemaName%>-edit.component';
import { <%-schm.SchemaName%>EditCustComponent } from '../<%-moduleName%>-cust/base/<%-schm.schemaName%>/<%-schm.schemaName%>-edit.cust.component';<%_
} %><%_
} %><%_
validatorFields.forEach(function(element){ %>
import { <%-element.Directive%> } from './<%-element.schemaName%>/<%-element.schemaName%>-edit/<%-element.schemaName%>-edit.component';<%_ }); %>
export class <%-ModuleName%>CoreModule { }