In my Angular Material app, I am using two controls which is textarea matInput and mat-slide-toggle. I followed the example online but somehow the ngModel is not working. For textarea I use ngModel, the data is not passed to the control. Only when I use
[value] the data is posted on the control but any changes is not reflected back on the object. For the mat-side-toggle, [(ngModel)] does not work. I have to use [checked].
Member
46 Points
283 Posts
Angular Material dual binding ngModel not working on input textarea and mat-slide
Aug 06, 2019 04:25 PM|comicrage|LINK
In my Angular Material app, I am using two controls which is textarea matInput and mat-slide-toggle. I followed the example online but somehow the ngModel is not working. For textarea I use ngModel, the data is not passed to the control. Only when I use [value] the data is posted on the control but any changes is not reflected back on the object. For the mat-side-toggle, [(ngModel)] does not work. I have to use [checked].
How can I get dual binding working? thanks.
Contributor
3710 Points
1043 Posts
Re: Angular Material dual binding ngModel not working on input textarea and mat-slide
Aug 08, 2019 06:04 AM|Yongqing Yu|LINK
Hi comicrage,
According to your description, I recommend you to use F12 tool to see if there are any error messages show.
If so , please tell us about this.
Best Regards,
YongQing.
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
70 Points
79 Posts
Re: Angular Material dual binding ngModel not working on input textarea and mat-slide
Nov 07, 2019 04:39 AM|ifour.parth@gmail.com|LINK
Hello,
ngModule lives in FormModule of @angular/form which can't with mat-slide and you are not use both ngModule and FormControl
As per yuor question first top you use F12 tool and inspect or debug your code.
http://www.ifourtechnolab.com/blockchain-technology