1

Using Angular 1.6

I´m trying to call some function like $scope.myFunction after change inputs

My code look like this

<md-input-container class="col-sm-12 md-block no-left-padding">
                        <label>Name</label>
                        <input name="name" ng-model="name" onfocusout="myFunction()">
</md-input-container>

I´m getting this error when I unfocus the input

Uncaught ReferenceError: myFunction is not defined
    at HTMLInputElement.onfocusout
Jaime2m1
  • 57
  • 5

1 Answers1

0

onfocusout behaves similar to onclick - it is standard JavaScript callbacks. To call function from scope/controller you need ng-*, probably you will be happy with ng-blur

Petr Averyanov
  • 9,327
  • 3
  • 20
  • 38