我创建了一个自定义原理图,一切正常,但是html代码未格式化。
<form [formGroup]="form" (ngSubmit)="onSubmit()">
<div class="row">
<% for (let formObject of htmlData) { %>
<div class="col-sm-<%= col %>">
<% if(formObject.type === 'text') { %><dz-input [control]="form.get('<%= formObject.name %>')"></dz-input><% } %>
<% if(formObject.type === 'select') { %><dz-select [control]="form.get('<%= formObject.name %>')"></dz-select><% } %>
<% if(formObject.type === 'checkbox') { %><dz-checkbox [control]="form.get('<%= formObject.name %>')"></dz-checkbox><% } %>
<% if(formObject.type === 'datepicker') { %><dz-datepicker [control]="form.get('<%= formObject.name %>')"></dz-datepicker><% } %>
<% if(formObject.type === 'multiselect') { %><dz-multiselect [control]="form.get('<%= formObject.name %>')"></dz-multiselect><% } %>
</div>
<% } %>
</div>
</form>
生成的HTML:
<form [formGroup]="form" (ngSubmit)="onSubmit()">
<div class="row">
<div class="col-sm-6">
<dz-input [control]="form.get('texto')"></dz-input>
</div>
<div class="col-sm-6">
<dz-input [control]="form.get('texto2')"></dz-input>
</div>
<div class="col-sm-6">
<dz-select [control]="form.get('teste_1')"></dz-select>
</div>
<div class="col-sm-6">
<dz-select [control]="form.get('teste2')"></dz-select>
</div>
<div class="col-sm-6">
<dz-checkbox [control]="form.get('oooo')"></dz-checkbox>
</div>
<div class="col-sm-6">
</div>
<div class="col-sm-6">
<dz-datepicker [control]="form.get('teste')"></dz-datepicker>
</div>
<div class="col-sm-6">
<dz-multiselect [control]="form.get('aaaa')"></dz-multiselect>
</div>
</div>
</form>
如何删除那些空白?我尝试修改index.html上的文件条目内容,但出现错误:
无法设置#的属性内容,其中只有一个 吸气剂
哪种方法是最好的?