I want to change the user input and model using a cutom directive like:
app.directive('changeInput', function ($parse) {
return {
require: 'ngModel',
link: function (scope, elm, attrs, ctrl) {
//insert logic here
});
}
};
});
So any time the user will insert char in:
<input
name="inputText"
type="text"
change-input
data-ng-model="data.name"
>
The input will change from 'a' to 'b' for example.
I just need the right logic for the change, I hane tried using $event and preventDefault() but it created more problams.
Thanks.