我有一个JSON文件,其中包含待售属性的列表。我正在尝试使用*NgFor遍历数据来创建一个列表。
首先,我对angular和应用程序开发仍然是一个业余爱好者,所以有可能我误解了文档等
我尝试过通过不同的路径进行循环
*NgFor="let post of posts.properties"
*NgFor="let post of posts.properties.property"
但仍然会出现各种错误。
我的理解是,我必须将可观察对象转换为一组属性。然后将其绑定到html。(我认为我所做的属性是数组类型?
json
{
"properties&
问题陈述
当我在HTML中使用*ngFor时,它会抛出错误:Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.,尽管我在*ngFor循环中使用了一个数组。
码
HTML,我使用的是棱角材质的mat-chips,在mat芯片内部,我使用的是*ngFor,这就是错误所在。
<mat-form-field class="techSkillsCo
我有一个使用angular 2和typescript显示的连接数组,如下所示:
<div class="list-item" *ngFor="let con of connectors; let i = index" id="con{{i}}" (click)="connectorSelected(con,i)">
<label class="list-name">{{con.name || "No Available Name"}}<
在Angular中可以对ngFor使用多个数组吗?
*ngFor="let device of element.devices && element.zones.devices"// something like this
export interface Element {
id: string;
name: string;
zones: Zone[];
devices: Device[];
}
export class Zone {
id: string;
name: string;
d