I have simple component that contains only form:
import {Component, FORM_DIRECTIVES, NgFor} from \'angular2/angular2\';
@Component({
selector: \'test-com
This is how we I do it:
<select class="form-control" name="selectedSignierer" #selectedSignierer="ngModel" [(ngModel)]="suisseIdDetail.selectedSigniererBenutzerId" required>
<option value="null" disabled selected>Select your option</option>
<option *ngFor="let item of signiererCatalog.entries;" value="{{ item.id }}" >{{ item.value }}</option>
</select>
<div *ngIf="fb.submitted && showSignDefinition === true && !selectedSignierer.valid" class="validation-error">{{ 'ERROR_FIELD_REQUIRED' | translate:lang }}</div>
<select class="form-control" [(ngModel)]="mySelect">
<option value="-1">Placeholder text..</option>
<!-- forloop of options heres -->
</select>
Then in your component. this.mySelect = -1;
I know i'm late , this is how i'm doing ,
initializeSelectOptions(){
this.optionList = ['..' , '..' , '..'
];
this.optionList.unshift('Select Options')
}
ngOnInit(){
this.initializeSelectOptions();
}
In my template ,
<select class='select-option' required [(ngModel)]='optionSelected' (ngModelChange)='optionChanged($event)'>
<option class='option' *ngFor='let option of optionList' [value]="option " [disabled]="option === 'Select Options'">{{option}}</option>
</select>