I am creating an angular 6 Project which was earlier developed using jquery and now I am stucked as if it is good to use jquery inside Angular 6 or I should remove all the jquery codes and replace it with Angular ?
-
2Better do not. There is not a point in using jquery or any related libs in an angular app. DOM manipulation is easier and less painful using a front-end framework. You can achieve the same things using an angular library instead. – kboul Jul 30 '18 at 09:08
-
No it's not, you're not supposed to handle DOM changes yourself in Angular. remove JQuery from your project. @kboul, Jquery **is** a front-end framework. – Jul 30 '18 at 09:09
-
2jquery is a js library not a framework – kboul Jul 30 '18 at 09:10
-
No,don't do DOM manipulation in your angular application using jquery it will create problem when you will create Angular Universal. – Kishan Jul 30 '18 at 09:57
-
1Man, if you don't want to use the jQuery library, make sure you know what jQuery is doing for you. http://youmightnotneedjquery.com/ – Snowbases Aug 27 '19 at 18:00
1 Answers
No, it is not a good idea. You are using jQuery coding practices in an Angular app and this will cause you headaches - for once because those practices go against the Angular spirit, and also because you don't reap the benefits of Angular.
You can do everything you do with jquery with angular like DOM changes , listen to event component event or windows event , create dynamic html elemnt and angular will track all these kind of change and your app doesn't have any side effect for example select elment value changes and angular haven't got this kind of changes.
you may thenk using jquery because you already have an experience or want to get the benefit of jquery plugins , currently there are alot of ui package realted to angular and some company develop a complete ui component like primeng,kendo ui
angular is a structure of how to build a web app so if you want to get the benefit of the app performance ,well done architecture base on the best practice of building web app, and app smallest size you have to stick to angular things like components and ui package.

- 23,240
- 8
- 66
- 91