0
my.component.html:隐藏的元素闪烁
<div [hidden]=shouldHideErrorMessage()>Error!</div>
my.component.ts:
public shouldHideErrorMessage(): boolean {
return this.Property == null || this.Property.IsGood
}
酒店最初为null,所以shouldHideErrorMessage()
返回true。但是当加载时,错误消息在屏幕上闪烁。我怎样才能防止呢?
使用'* ngIf'不是一种选择吗? – Faisal
我觉得你的病情不清楚,如果检查为空,为什么this.Property.IsGood –