I have used ngModel
and formControlName
together so I am getting warning in console. I want to remove that warning but I am not able to figure out if I am removing ngModel
in it than with what should I replace it. I tried couple of code but it's not working.
This is my component.html file:
<mat-select
formControlName="store"
[(ngModel)]="this.form.value['store']"
(selectionChange)="changestore()"
multiple>
</mat-select>
This is my component.ts
changestore(){
this.storeTechData.forEach((element:any)=> {
if(this.form.value['store'].includes(element['store_id'])){
element['active'] = true;
}else{
element['active'] = false;
}
});
}
I tried reactive form and stuff but I am not getting required output. Someone please replace ngModel
with reactive form or any thing else so that I will get the required output and also warning will not appear in the console