2017-02-23 111 views
0
<md-input-container> 
    <input mdInput type="number" min="0" [(ngModel)]="troup.amount" *ngIf="wave.Mode === SimulationModes.Normal"> 
</md-input-container> 

我最近從以前版本的材料角到最新的信息更新,並需要改變我所有的投入相匹配的新標準與<md-input-container>而不是<md-input>角2材料:「表達改變[..]」以mdInput

當編譯時,我得到一個區域錯誤,告訴它該值從「undefined」更改爲「'。

回答

0

爲了使其工作,你不再需要把任意*ngIfmdInput指令,但這應該被放置在容器而不是上:

<md-input-container *ngIf="wave.Mode === SimulationModes.Normal"> 
    <input mdInput type="number" min="0" [(ngModel)]="troup.amount"> 
</md-input-container> 

這解決了問題。