Just uninstall
[attr.selected]="role == user.role ? 'true' : 'false'"
and assign the selected role to user.role , and ngModel will make the corresponding element selected.
If the role object is an object, the assigned instance must be identical.
See also the recently added custom comparison. Https://github.com/angular/angular/issues/13268 is available from version 4.0.0-beta.7
<select [compareWith]="compareFn" ...
compareFn(val1, val2): boolean { return val1 && val2 ? val1.id === val2.id : val1 === val2; }
source share