Open SaiSatwik opened 3 months ago
The current functionality is as expected, although I agree we should offer an option to eliminate such whitespace.
To prevent whitespace generation, adjust the template as shown below:
<% for (let row of getComponents().rows) { %>
<div class="row"><% for (let field of row.fields) { if (field.type === 'InputString') { %>
<field labelCode="code" class="col-sm-6 col-md-3">
<input name="code" ngModel [readonly]="readOnly">
</field><% }} %>
</div><% } %>
This revision maintains the structure while reducing unnecessary whitespace between elements.
Command
generate
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I have ng schematics template
__name@dasherize__.component.html
with content :I build it with :
Generated code creates empty lines on place where is put command "<%" in template, see:
Is there anyway these white spaces can be avoided. If we have to do it manually, it might kill the purpose of this code generator tool
Minimal Reproduction
Write a schematic template code with inline code <% inline code %>. Then build and generate code using commands
We can see generated code is having while spaces wherever inline code is present.
Exception or Error
No response
Your Environment
Anything else relevant?
No response