0
我使用自定義指令下拉並使用link()
方法綁定下拉菜單,但ng-change
事件未觸發。Angular JS - ng-change event is not firing
app.directive("reportfId", function(){
return {
restrict:'AE',
template: '<select id="item" multiple="multiple" ng-model="item" class="form-control" style="display:inline-block; " ng-change="binddl()" ></select>',
link: function(scope, element, attrs, ctrl)
{
$.each(scope.freports, function (i, value) {
element.append(new Option(value.name, value.id, false, false));
});
element.multiselect({ multiple: false, minWidth: 158, selectedList: 1, height: 100, noneSelectedText: "Select Report ", header: "Select Report" }).multiselectfilter();
}
}
});
定義binddl函數在哪裏? – Silvinus