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

I've recently updated from the previous version of material angular to the newest one, and needed to change all my inputs to match the new criteria with <md-input-container> instead of <md-input>.

When compiling, I get a Zone Error telling that the value changed from "undefined" to ''.

briosheje
  • 7,356
  • 2
  • 32
  • 54

1 Answers1

0

In order to make it work, you no longer should put any *ngIf in the mdInput directive, but this should be placed on the container instead:

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

This solves the issue.

briosheje
  • 7,356
  • 2
  • 32
  • 54