below is my snippet in my directive which calls a controller
element.bind('change', function() {
//alert("inside change function");
$rootScope.selectedBankName = scope.selectedBankName;
newvalue = scope.selectedBankName;
$timeout(function() {
scope.changeClient();
}, 500);
});
If I use above code It is calling changeclient() function for every element change. but my requirement is I need to call the changeClient function when I change the value in the select box only.please suggest me how to do this.
EDIT:
http://plnkr.co/edit/clTJjlZRlErskt6T0Foc?p=preview
please find the plunker code when I change some value in textbox or dropdown and click any where it is displaying alert box. But my requirement is the alert should be displayed only when I change dropdown value and click anywhere(not for textbox).