简体   繁体   English

从 Angular 应用程序中删除 JQuery 依赖项

[英]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”或“jqLit​​e” .”

So to summarize...所以总结...

  1. search for $.搜索$.
  2. search for jQuery搜索jQuery
  3. search for uses of element that rely on jQuery and not just jqlite搜索依赖 jQuery 而不仅仅是jqliteelement使用

Thanks again to those who commented!再次感谢评论的人!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM