这是添加jQuery和Angularjs在一个项目的正确方法 [英] Which is the right way to add Jquery and Angularjs in one project

查看:105
本文介绍了这是添加jQuery和Angularjs在一个项目的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始加入jQuery和AngularJs在我们的下一个项目。
我看到一些文章说AngularJs和AngularJs后使用jQuery的一些文章之前使用jQuery。所以,我有点迷惑哪一个是正确的。

I am starting to add Jquery and AngularJs in our next project. I seen some article say use Jquery before AngularJs and Some article used Jquery after AngularJs. so, I am little confuse about which one is right.

看KendoUI使用AngularJs前jQuery和自己的库后。

see KendoUI used jquery before AngularJs and their own library after it.

<script src="jquery.min.js"></script>
<script src="angular.min.js"></script>
<script src="kendo.all.min.js"></script>

什么是AngularJs后AngularJs和剑道或其他库之前的背后使用jQuery的概念。

What is the concept behind use jquery before AngularJs and Kendo or other library after AngularJs.

和为什么我们AngularJs使用它之前kendoUI将无法正常工作,什么是它背后的理念。

And why kendoUI will not work if we use it before AngularJs, what is the concept behind it.

推荐答案

角可以使用或不jQuery的工作。如果没有的jQuery已经加载加载,它会使用jQLite其中只有jQuery的功能了一把。 参考

Angular can work with or without jQuery. If loaded without jQuery already loaded, it'll use jQLite which only has a handful of jQuery functions. Reference

所以,如果你计划在JS使用jQuery是有意义角之前加载,这将prevent jQLite从根本上被装载。

So if you plan to use jQuery in your JS it makes sense to load it before Angular which will prevent jQLite from being loaded at all.

剑道UI包括角指令,除非角框架之前加载,这将无法正常工作。

Kendo UI includes Angular directives, which won't work correctly unless the Angular framework is loaded before it.

同样的原则也适用于使用该角框架的库。如果库不使​​用它,然后加载顺序没有任何影响。

The same principle would apply to any library that uses the Angular framework. If a library does not use it then the load order has no effect.

这篇关于这是添加jQuery和Angularjs在一个项目的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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