When coding in HTML,
<select class="element-margin-top" ng-model="vm.selectedRole" ng-options="(roleName,enabled) in vm.roleNames">
<option value="">All Roles</option>{{vm.roles[0]}}
</select>
I am trying to populate all the array elements as select options, but I'm encountering an error regarding (roleName,enabled) in vm.roleNames that I am unable to understand.
In JavaScript:
var vm = this;
vm.roleNames = ['SuperAdmin','Admin','Retailer','Manufacturer'];
vm.selectedRole = vm.roleNames[0];
I want the first element to be automatically selected by default.