@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
41 lines (38 loc) • 1.69 kB
HTML
<%_{
let pictureFields = viewFields.filter(x => x.picture);
let indexedFields = viewFields.filter(x => !x.picture && x.isIndexField);
let otherFields = viewFields.filter(x => !x.picture && !x.isIndexField);
let otherFieldsName = otherFields.map(x=>x.fieldName);
if (indexedFields.length > 0){%>
<div class="grid-head">
<div class="ms-1 d-inline-block">
<h5><%
for (let [index, field] of indexedFields.entries()){
if (field.hidden) continue;
let fn = field.fieldName; let ft = field.type;
let fieldObj = {field, fn, ft, ref_link: true,};
%>
<div class="me-1 d-inline-block">
<%- include(`/ui/${uiFramework}/${uiDesign}/schema-display.field-wrap.html`, fieldObj); %>
</div><%_
}%>
</h5>
</div>
</div><%}%>
<div><%
for (let fieldGrp of viewGrp) {
let fieldGrpProcessed = fieldGrp.filter(x=>otherFieldsName.includes(x.fieldName) && !x.hidden);
if (fieldGrpProcessed.length < 1) {
continue;
}%>
<div><%for (let field of fieldGrpProcessed) {
let fn = field.fieldName; let ft = field.type;
let fieldObj = {field, fn, ft, ref_link: true,};
%>
<div class="d-inline-block me-5" style="min-width: 160px;">
<div class="d-inline-block"><label><%-field.displayName%>:</label></div>
<div class="d-inline-block ms-3"><%- include(`/ui/${uiFramework}/${uiDesign}/schema-display.field-wrap.html`, fieldObj); %></div>
</div><%}%>
</div><%}%>
</div><%
}%>