无法使用ng-options为select选择提供操作

时间:2014-08-07 09:38:21

标签: angularjs

<select ng-change="updateFirmTimeZone(timeZoneId)" ng-model="timeZoneId" ng-options="timeZoneId as tz.offset for tz in availableTimezones"></select>

updateFirmTimeZone(timeZoneId)未调用。如何为选择提供行动?任何其他建议。请更新。提前谢谢。

1 个答案:

答案 0 :(得分:1)

tz.id as tz.offset for tz in availableTimezones 

tz.timeZoneId  as tz.offset for tz in availableTimezones

而不是

`timeZoneId as tz.offset for tz in availableTimezones`

<强> HTML:

<select ng-change="updateFirmTimeZone(timeZoneId)" ng-model="timeZoneId" ng-options="tz.id as tz.offset for tz in availableTimezones"></select>