Ionic错误v.context.$ implicit未定义 [英] Ionic Error v.context.$implicit is undefined
问题描述
我的代码中有错误. 该错误是这样说的: v.context.$ implicit未定义
I have the error in my code. The error says like this: v.context.$implicit is undefined
问题是,有时会出错,有时却不会…… 有人可以解释为什么会发生……
The problem is, sometimes it error, and sometimes it doesn’t… Can somebody explain why it happen…
这是我的html代码:
This my html code:
<ng-container *ngFor="let time of item.timeInfo | keys" >
<ion-row *ngIf="time == thisDay">
<ion-col col-3 no-padding>
<ng-container *ngIf="checkTime(); else closeButton">
<button small ion-button block color="secondary" outline> OPEN </button>
</ng-container>
<ng-template #closeButton>
<button small ion-button block color="danger" outline>Close </button>
</ng-template>
</ion-col>
<ion-col col-9 >
{{ item.timeInfo[thisDay].open }} - {{ item.timeInfo[thisDay].close }}
</ion-col>
</ion-row>
</ng-container>
这是我的json代码:
Here my json code:
"item":{
"timeInfo": {
"Sat": {
"open": "11:00",
"close": "21:00"
},
"Sun": {
"open": "9:00",
"close": "21:30"
},
"Mon": {
"open": "11:00",
"close": "22:30"
},
"Tue": {
"open": "12:00",
"close": "22:00"
},
"Web": {
"open": "12:00",
"close": "22:30"
},
"Thu": {
"open": "9:30",
"close": "22:30"
},
"Fri": {
"open": "12:30",
"close": "22:00"
}
},
};
这是我的版本:
@ionic/cli-utils : 1.15.2
ionic (Ionic CLI) : 3.15.2
local packages:
@ionic/app-scripts : 3.0.0
Ionic Framework : ionic-angular 3.7.1
System:
Node : v6.11.2
npm : 5.4.2
OS : Windows 8.1
Misc:
backend : pro
有人可以帮我吗? Tyvm
Can somebody help me?? Tyvm
推荐答案
如果我看不到您是TS代码,那么我真的帮不上忙.
我遇到了同样的问题,我的错误是试图在像result[i] = data[i]
而不是像result.push(data[i])
这样的数组中插入一个新数据,这实际上是正确的.希望能帮助到你 !
i can't really help if i don't see you're TS code.
The same problem occured to me and my mistake was to try to insert a new data in an array like result[i] = data[i]
and not like result.push(data[i])
which is actually correct. Hope it helps !
这篇关于Ionic错误v.context.$ implicit未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!