有没有什么办法可以在不使用控制器的情况下为select设置默认值?默认值为<select>使用ng-input
我试过很多方法。这是最后一个......
<select [(ngModel)]="model.carColour" [ngModelOptions]="{standalone: true}" class="form-control input-sm" ng-init="model.carColour='select'">
<option value="select">Select color</option>
<option></option>
<option *ngFor="let item of carscolours" [value]="item.value"> {{item.text}}</option>
</select>
我需要设置“选择颜色”为默认值,并在下拉列表为空字符串,并从库项目。
问题仍然存在 – Antatrix