ng-options add suffix to each option

后端 未结 2 1190
借酒劲吻你
借酒劲吻你 2021-01-21 01:59

Suppose i have the following array with strings:

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

2条回答
  •  失恋的感觉
    2021-01-21 02:16

    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.

提交回复
热议问题