I have the following code
<select name="role" [(ngModel)]="user.role">
<option *ngFor="let r of roles" [ngValue]="r">{{r.name}}</option>
</select>
where roles is an Object:
[{"id":1, "name":"user"}, {"id": 2, "name":"admin"}]
and user.role is for example:
{"id":1, "name":"user"}
I want initial value to be the user.role, I've tried a lot of things like ngInit, but it didn't get the job done.