I have an undefined number of columns and the length of the fields is undefined. To display them there is this code:
<div class="col-md-6" *ngFor="let d of fields">
<div class="form-group">
<label>{{ d.displayName }}</label>
<span>{{ viewRecord[d.fieldName]}}</span>
</div>
</div
Result:
<div class="col-md-6">
<div class="form-group">
<label>Title 1</label>
<span>Text 1....</span>
</div>
</div
<div class="col-md-6">
<div class="form-group">
<label>Title 2</label>
<span>Text 2....</span>
</div>
</div
Is it possible to put these two in one container as follows:
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Title 1</label>
<span>Text 1....</span>
</div>
</div
<div class="col-md-6">
<div class="form-group">
<label>Title 2</label>
<span>Text 2....</span>
</div>
</div
</div>
Please note that I do not know the number of fields, so I need to make module 2 from the total number of fields to transfer a pair of fields into one container. Obviously, the shell will be out of cycle. I am stuck:)
Please note that I am looking for an answer with a template . If not, I can handle this. Any JavaScript I can write myself;)
source
share