【发布时间】:2019-01-11 12:15:12
【问题描述】:
My array structure in my application
我在我的应用程序中获得了上述数组结构,然后将其分配给我的变量,如下所示:
`
.subscribe(data => (
this.user = data,
console.log('rain', this.user)
));`
但我无法在 HTML 中显示它。我试图显示以下方式
` <ion-option *ngFor="let users of user">{{users[0].pentad1.
rainfall}}</ion-option>
</ion-select> `
有人可以帮我解决这个问题吗?
【问题讨论】:
-
请完整显示功能。
-
this.api.get_pentad1(param) .subscribe(data => (this.user = data[0], console.log('rain', this.user) ));我的功能只包含这个
-
@user7500984 我认为这一行应该是 {{users[0].pentad1.根据您的对象响应降雨}}
-
是的,你是正确的。 Stackoverflow 给了我错误,所以我不得不删除它。我的 HTML 是
{{users[0].pentad1.rainfall}}