On Blur (On Change) action
mhipo1364 opened this issue · 1 comments
mhipo1364 commented
Hi guys
Is there any event listener about blur or change action in input?
milad1367 commented
add this "onBlur": "&"
to scope.
add onBlur to selectResult:
vm.selectResult = function(result) {
if (vm.matchClass) {
result.title = result.title.toString().replace(/(<([^>]+)>)/ig, '');
}
vm.searchStr = vm.lastSearchTerm = result.title;
// vm.selectedObject = result;
vm.selectedObject = result.originalObject;
vm.onBlur({user:result.originalObject});
vm.searchStr = "";
vm.showDropdown = false;
vm.results = [];
//$scope.$apply();
}
and this :
<ibd-autocomplete-input id="{{vm.unicId}}"
placeholder="{{vm.unicId}}"
pause="100"
selectedobject="vm.input"
localdata="vm.allUsers"
searchfields="username"
titlefield="username"
minlength="1"
imagefield="pic"
inputclass="form-control form-control-small"
on-blur = "vm.addUser(user)"
/>