Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng-focus and ng-blur events not triggering in Angularjs

<input type='text' ng-focus='tryFunc()'> </input>

The function tryFunc() is not called when the input box is focused.

I am including jQuery.min.js in the file and it is before angular.min.js jQuery is version v1.10.2 and Angular.js is v1.0.7.

What may be happening?

like image 362
Program_Sauce Avatar asked Aug 31 '13 14:08

Program_Sauce


1 Answers

ngFocus is not available on Angular 1.0.7. It's available on Angular 1.2.

You can create your own ngFocus directive, it's quite simple, have a look here:

https://gist.github.com/eliotsykes/5394631

like image 67
Wagner Francisco Avatar answered Oct 11 '22 06:10

Wagner Francisco