Problem with Form (Data driven)
I have an array of objects (dashed block in the gif) that builds the view. The GIF below shows the error:
Each dashed block is a iteration of *ngFor="let price of priceOptionsList;let pr = index;"
directive.
This is the object model:
{
value ? : number,
description : string,
beginDate : string,
endDate : string,
periodActivated : boolean
}
The button PERÍODO DE VIGÊNCIA
changes the boolean value of periodActivated
, that shows date/time inputs.
The button ADICIONAR VALOR
adds an object in the array:
this.priceOptionsList.push({
"value" : undefined, // In the view, it's displays the value of the position [0], error!
"beginDate" : '',
"endDate" : '',
"description" : '',
"periodActivated" : false
});
When I click in the buttons, the view changes and not display the value in some inputs (see gif, description and date/time inputs get empty), but the model is the same, there is no changes!
I think it is a BUG, I am correct?