【发布时间】:2020-08-28 21:26:25
【问题描述】:
我有一个动态列表,其中包含一些输入和选择字段,我想通过这些字段绑定动态数据。我尝试与 ngModel 绑定,但它只显示最后一个对象的条目。这是我要绑定的数据
properties=[
{
"Id": "01",
"PropertyType": null,
"PropertyTypeId": 1,
"PropertyName": "Name",
"AdditionalList": []
},
{
"Id": "02",
"PropertyType": null,
"PropertyTypeId": 1,
"PropertyName": "Phone",
"AdditionalList": []
},
{
"Id": "03",
"PropertyType": null,
"PropertyTypeId": 1,
"PropertyName": "Work Phone",
"AdditionalList": []
}]
提前谢谢...
【问题讨论】:
-
看看angular.io的ngFor。此外,Angular 中的强类型模型。
-
@r2018 谢谢,但你能提供一个具体的链接吗?
-
@P.Dederer 在回答中给出了它的用法示例