在 Angular 中使用 jQuery 是一种不好的做法吗? [英] Is it a bad practice to use jQuery in Angular?

查看:29
本文介绍了在 Angular 中使用 jQuery 是一种不好的做法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题如下.我应该避免在 Angular 应用程序中使用任何类型的 jQuery 代码,因为只有一件事与 DOM 交互似乎是合法的.另一个问题是,是否有人遇到过除了使用 jQuery 编写快速 hack 之外找不到任何其他解决方案的问题.

My question is the following. Should I avoid using any kind of jQuery code in Angular application as it seems legit to have only one thing interacting with DOM. Another question is if anyone came across problems where he couldn't find any other solution but writing a quick hack with jQuery.

谢谢!

推荐答案

是的,这是一个不好的做法,但有时它会为您节省很多时间,尤其是当您正在寻找插件时,只在必要时才做,并记下当其他解决方案可用时切换回来.

Yes it's a bad practice, but sometimes it will save you much time, especially when you are looking for a plugin, Do it when necessary only, and keep a note to switch it back when other solutions are available.

这篇关于在 Angular 中使用 jQuery 是一种不好的做法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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