What is the easiest way to select default value of select box, by using angularJs?
I have this control:
<div class="col-md-1">
<label for="timeZone">Time zone</label>
<select id="timeZone" name="timeZone" class="form-control"
ng-model="newTestSessionCtrl.formData.timeZoneValues"
ng-options="timeZone.name for timeZone in newTestSessionCtrl.viewData.timeZoneValues">
<option value="" disabled selected>Select</option>
</select>
</div>
And in my controller I have definde timeZoneValues like this:
timeZoneValues: [{value: "UTC", name: "UTC"}, {value: "UTC+1", name:"UTC+1"}]
What I was trying to do is to use ng-init. Like it is explained here but I guess I am doing something the wrong way.
What I am trying to do is to select UTC by default.