我正在使用AngularJS Dropdown Multiselect。 http://dotansimha.github.io/angularjs-dropdown-multiselect/#/
我想要同时使用这两个事件。但不知道如何配置两者。我只能成功配置其中一个。
onItemSelect(property)
和
onItemDeselect(property)
HTML
<div ng-dropdown-multiselect="" options="property.dropdowns" selected-model="property.propertyValues"
extra-settings="multiSelectDropdownSettingsMaxOne" ng-required="property.startDate != null" events="onItemSelect(property)"></div>
更新
我尝试使用逗号分隔符,但出现错误
<div ng-dropdown-multiselect="" options="property.dropdowns" selected-model="property.propertyValues" extra-settings="multiSelectDropdownSettingsMaxOne" ng-required="property.startDate != null" events="onItemSelect(property), onItemDeSelect(property)"></div>
答案 0 :(得分:10)
试试这个:
$scope.yourEvents = {onInitDone: function(item) {console.log(item);},onItemDeselect: function(item) {console.log(item);}};
<div ng-dropdown-multiselect="" options="YourData" events="yourEvents"
selected-model="YourModel" extra-settings="yourSettings">
</div>
[source]