I have a material slide toggle button and it is two way bind with a string variable having a value "true" or "false" using [(ngModel)], the button updates the value of variable correctly when i toggle it, but for the first time when it is loaded in DOM, it always shows its state to true even if the value in the variable is "false".
<div *ngIf="agent.attributes[i].type == 'Boolean'">
<mat-slide-toggle [checked]="agent.attributes[i].value == 'true' ? true : false"
[(ngModel)]="agent.attributes[i].value">{{agent.attributes[i].value}}</mat-slide-toggle>
</div>