【发布时间】:2014-02-13 01:24:13
【问题描述】:
我正在使用https://github.com/localytics/angular-chosen 指令来创建简单的多选控件。
这应该很简单,但是 select 上的 ngModel 没有得到更新。
这里是角度控制器代码:
var app = angular.module('Simple', ['localytics.directives'])
.controller('SimpleCtrl', function ($scope, $http) {
$scope.states = ['one', 'two', 'three', 'four']
$scope.state = ['one'];
});
HTML:
<select multiple
chosen
ng-model="state"
ng-options="s for s in states">
<option value=""></option>
</select>
<p ng-repeat="s in state">{{s}}</p>
除了“状态”之外的所有东西都不会更新。我正在使用 angularjs 1.2.10。 我会很感激任何建议。谢谢。
这是提出相同问题的 jsfiddle http://jsfiddle.net/mousenine/MQzXq/12/
【问题讨论】:
标签: javascript jquery angularjs jquery-chosen