The input is the following:
The action() is exe
Another solution would be to use a directive that watched the model for any changes instead of using ng-change.
app.directive('onModelChange', function($parse){
return {
restrict: "A",
require: "?ngModel",
link: function(scope, elem, attrs, ctrl) {
scope.$watch(attrs['ngModel'], function (newValue, oldValue) {
if (typeof(newValue) === "undefined" || newValue == oldValue) {
return;
}
var changeExpr = $parse(attrs['onModelChange']);
if (changeExpr) {
changeExpr(scope);
}
});
}
};
});
Then you would use it like so: