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

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

问题描述

我的问题如下.我应该避免在Angular应用程序中使用任何种类的jQuery代码,因为只有一件事与DOM交互似乎是合法的. 另一个问题是,是否有人遇到无法找到其他解决方案但只能用jQuery进行快速破解的问题.

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天全站免登陆