我想使用指令绑定到以下选择元素中选项元素的 mouseover 和 mouseleave 事件:
<select class="form-control" jr-option-bind="" ng-model="vm.selectedPersonalInfo" ng-options="personalInfo as personalInfo.name for personalInfo in vm.personalInfos"></select>
这行不通。jr-option-bind 是我的指令:
function link(scope, element, attrs) {
var options = element.children();
options.bind('mouseover', function(){
console.log('mouseover');
});
options.bind('mouseleave', function(){
console.log('mouseleave');
});
}