
我们的要求是使用Asp.Net WebAPI和AngularJs构建响应式Web应用程序;现在要使我们的应用程序响应我们希望使用bootstrap,而bootstrap需要bootstrap CSS和jquery库;那么我们应该将jquery libary和AngularJs库添加到我们的项目中吗?
解决方法 是的你可以,但不推荐它,因为jquery增加了很多开销.如果您要编码“角度方式”,那么您将不会破坏角度功能.例如,如果您尝试调整字段的值,则在手动触发摘要之前,范围不会更新.它会导致垃圾代码和不一致的行为.
Does Angular use the jquery library?
Yes,Angular can use jquery if it’s present in your app when the
application is being bootstrapped. If jquery is not present in your
script path,Angular falls back to its own implementation of the
subset of jquery that we call jQlite.Angular 1.3 only supports jquery 2.1 or above. jquery 1.7
and newer might work correctly with Angular but we don’t guarantee that.
Source
另见这个问题:Should we use jQuery with AngularJS?
如果您确实想要使用jquery,请确保首先包含jquery脚本. Angular将加载jquery代替JQ lite.
总结以上是内存溢出为你收集整理的我们可以在Web应用程序中同时使用jQuery和Angular吗?全部内容,希望文章能够帮你解决我们可以在Web应用程序中同时使用jQuery和Angular吗?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)