我目前正在使用带有给我的json文件的angular框架制作一个简单的表单。 json内有一些数组和对象。好吧,我成功绑定了json数组。我现在的问题是我不知道该如何使用json对象。我无法将json文件中所述的列绑定到我的表单,而是在UI中显示了列数。我已经尝试过使用ngFor,但是错误提示ngFor仅支持绑定到数组等可迭代对象。我实际上对角和这种角材料不熟悉。任何帮助将不胜感激
这是json文件。用红色包围的json对象是我要在表单中绑定的列
答案 0 :(得分:0)
您不需要colums
字段值。您可以简单地将display: flex
用作<section>
:
<section style="display:flex; justify-content: space-between;" class="section" *ngFor="let inputSection of inputs.sections">
<div class="section-content" *ngFor="let field of inputSection.fields; let i = index;">
[...]
</div>
</section>