indrimuska / angular-selector

A native AngularJS directive that transform a simple <select> box into a full html select with typeahead.
http://indrimuska.github.io/angular-selector
MIT License
96 stars 36 forks source link

Change event never fires #46

Closed swimmadude66 closed 8 years ago

swimmadude66 commented 8 years ago

Assigning a function to change, the function is never called with the arguments promised.

controller.js

$scope.log=function(){
    console.log(arguments);
};

If change="log" it will never fire. If change="log()" it fires, but always with empty arguments.

indrimuska commented 8 years ago

Hi @swimmadude66, you're not passing through the data in your HTML. Because of how Angular evals functions you need to pass the parameters you're trying to get to your log function in the HTML, like this:

<select ... change="log(newValue, oldValue)" ..></select>