Okay, I'm sure I'm missing something, but I don't see it.
I created a fiddle that I would think of by throwing a warning when the input field loses focus, but it does not work and I do not know why.
I was expecting a warning when the user performs the following steps:
- click input box
- enter something
- click somewhere outside the input field
but a warning message is not displayed in these steps.
Of course, someone knows what I'm doing wrong ...?
Here's the code (the same as the fiddle):
<div ng-app> <div ng-controller="MyCtrl"> <form name="myForm"> <input type="text" ng-model="todoText" size="30" name="myInput" ng-blur="validate(myForm)"> </form> </div> </div> function MyCtrl($scope) { $scope.validate = function(form) { alert('blur!'); }; }
source share