Reputation: 58083
I have form object "formObject"
and i want to have a form.invalid
in formObject.isFormValid variable.
any help is appreciated.
export class formObject{
public isFormValid:boolean ;
.. other fields
}
<form #my-form="ngForm" >
<input type="hidden" [(ngModel)]="formObject.isFormValid" value="my-form.invalid"/> {{my-form.invalid}}
</form>
Upvotes: 0
Views: 1245
Reputation: 15270
Setting value
attribute does not trigger change for input and model is not updated. You have to use another way to update formObject.isFormValid
.
Upvotes: 1