Is there a way to set a default value in the drop-down menu below?
<div hidden id="projectSelected">
<label style="font-size: medium">Project *</label>
<select name="projectSelected" id="projectSelectedId" class="form-control"
ng-model="request.projectSelectedBarcode" required>
<option ng-repeat="prj in projectList" value="{{prj.Barcode}}">{{ prj.Name }}</option>
</select>
<div style="color:maroon" ng-messages="getServiceReuqestForm.projectSelected.$error"
ng-if="getServiceReuqestForm.projectSelected.$touched">
<div ng-message="required">This field is required</div>
</div>
</div>
In this code snippet, the projectList
represents data fetched from an OData call. I am wondering if it's possible to automatically select one of the returned values as the default option in the drop-down list.