[英]Removing JQuery dependency from Angular app
In the process of removing JQuery dependency from our Angular project.在从我们的 Angular 项目中移除 JQuery 依赖的过程中。 Most of the work to remove JQuery has been done.
删除 JQuery 的大部分工作已经完成。
Currently I'm just doing a global find on ' $.
目前我只是在'
$.
上进行全局查找$.
' to identify those sections of code that still utilize JQuery. ' 来标识那些仍然使用 JQuery 的代码部分。
Is there something else I should be searching for?还有什么我应该寻找的吗?
Thanks to @tushar and @taxicala for suggesting I also search for jQuery (in case the alias is not used).感谢 @tushar 和 @taxicala 建议我也搜索 jQuery(以防不使用别名)。
In addition to searching for '$.'
除了搜索
'$.'
and 'jQuery'
, we've also found reliance on jQuery from element
in our directives.和
'jQuery'
,我们还发现我们的指令中的element
依赖于 jQuery。
From the Angular element
docs : "If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite.”"来自Angular
element
docs :“如果 jQuery 可用,angular.element 是 jQuery 函数的别名。如果 jQuery 不可用,angular.element 委托给 Angular 的内置 jQuery 子集,称为“jQuery lite”或“jqLite” .”
So to summarize...所以总结...
$.
$.
jQuery
jQuery
element
that rely on jQuery and not just jqliteelement
使用Thanks again to those who commented!再次感谢评论的人!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.