I have this:
<select class=" text-center form-control" name="custname"
ng-model="a.custid"
ng-init="devcustname[0].customer_name"
ng-change="fetchassocd(a)">
<option value="" selected="true">Please select a Customer name</option>
<option ng-repeat="a in devcustname | orderBy:['customer_name']"
value="{{a.customer_id}}">{{a.customer_name}}
</option>
</select>
I want the default value to be devcustname[0].customer_name. The ng-init is not working. When the devcustname[0].customer_name is null or undefined I want the "Please select a Customer name" to be displayed as default.
If I use ng-options I can't show the "Please select a Customer name"".
ng-init="devcustname[0].customer_name || a.custid = ''"and<option value="">Please select a Customer name</option>ng-initjust doesn't work even when there are values.