Suppose i have the following array with strings:
$scope.open_slots = ["00","10","50"], and i would like to have the following results:

without doing this : $scope.open_slots = ["00 minutes","10 minutes","50 minutes"]
how can i just add suffix to each item in the select option list?
this is my code:
<select data-ng-model="minutes_per_slot" data-ng-options="item for item in open_slots"></select>
You can do it using the as part of the ngOptions:
ng-options="slot as slot+' minutes' for slot in open_slots">
See, also, this short demo.
Try:
<select data-ng-model="minutes_per_slot"
data-ng-options="item as item + ' minutes' for item in open_slots">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With