How to pass the input element as a parameter in ng-blur?

10,857
<input type="number" value="{{ bom.Id._Value }}" name="id" data-ng-model="bom.Id._Value" data-ng-blur="myClass.myFunc($event);" required>

In Controller:

myClass.myFunc = function(e){
  console.log(e.target);
};
Share:
10,857
dude
Author by

dude

Updated on July 24, 2022

Comments

  • dude
    dude almost 2 years

    This is my input:

    <input type="number" value="{{ bom.Id._Value }}" name="id" data-ng-model="bom.Id._Value" data-ng-blur="myClass.myFunc();" required>
    

    If I pass this or angular.element(this) in the ng-blur I don't get the input element in the function. What I want is to receive the current input element in myFunc() as a parameter. What is the standard way for it?