I want to set selected value from an HTML dropdown from a Angular2 component. I'm failing to see if this should be working or I need something more complex
HTML
<select class="form-control" id="role" [ngModel]="SelectedRole">
<option *ngFor="#option of Roles" [value]="option.Value">{{option.Text}}</option>
</select>
COMPONENT
export class MyComponent extends Secured {
public SelectedRole: String = "4";
...
constructor() {
}
}
From this code, I'd expect ítem with value 4 to be selected at the begining and that's not happening.