难道AngularJS真的需要jQuery的? [英] Does AngularJS really need jQuery?

查看:117
本文介绍了难道AngularJS真的需要jQuery的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读的AngularJS自带的jQuery的精简版的版本。不过,我不断听到提及谁谈角和jQuery一起去的人。我甚至检查了 NG-电网并注意到它说:

I was reading that AngularJS comes with a lite version of jQuery. However I keep hearing reference to people who talk about Angular and jQuery going together. I even checked out ng-grid and noticed that it says:

角数据网格

所以,如果我不使用角只是当我需要jQuery和又有什么当属AngularJS的一部分而提供的版本?

So if I do use Angular just when would I need jQuery and what does the version that comes as part of AngularJS not provide?

推荐答案

jQLite是jQuery的一个非常精简版本。 jQLite是足够的角度来工作。这是消除任何依赖。

jQLite is a very stripped version on jQuery. jQLite is enough for angular to work. This is to remove any dependencies.

然而,如果您加载之前的jQuery的 的角,然后将角使用jQuery。

Yet, if you load jQuery before angular, then angular will use jQuery.

大部分的时间,你不需要使用jQuery。即使这么多,对于初学者,建议彻底离开了jQuery的,因为会使用jQuery的趋势时,有一个简单/角度的方法。已经有这样的例子很多关于这个(主要是展示,并通过jQuery的隐藏元素时有 ngShow ngHide 指令)

Most of the times, you do not need to use jQuery. Even so much that, for beginners, it is advised to leave out jQuery completely as there would be tendency to use jQuery when there is an easy / angular way. There has been so many examples on this (mostly showing and hiding element through jQuery when there is ngShow and ngHide directives).

后来,当你开始写指令,那么你可能需要添加jQuery的。

Later on, when you start to write directives, you then may need to add jQuery.

ngGrid 可以做这么多的事情,其中​​ jqLit​​e 是不够的。于是,他们用的jQuery

ngGrid possible does so much things that which jqLite would not suffice. Thus, they used jQuery.

jqLit​​e的文档和特点:
<一href=\"http://docs.angularjs.org/api/angular.element\">http://docs.angularjs.org/api/angular.element

Documentation and features of jqLite: http://docs.angularjs.org/api/angular.element

这篇关于难道AngularJS真的需要jQuery的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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