NG-重点和NG-模糊事件Angularjs不触发 [英] ng-focus and ng-blur events not triggering in Angularjs

查看:197
本文介绍了NG-重点和NG-模糊事件Angularjs不触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

功能 tryFunc()时,在输入框中的重点是不叫。

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

我包括 jQuery.min.js 文件中,它是前 angular.min.js 的jQuery是版本v1.10.2的和Angular.js是v1.0.7。

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.

什么可能会发生?

推荐答案

ngFocus不适用于角1.0.7。它可以在1.2角

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

您可以创建自己的ngFocus指令,这是相当简单的,看看这里:

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

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

这篇关于NG-重点和NG-模糊事件Angularjs不触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆