Reputation: 197
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 ?
Upvotes: 7
Views: 1890
Reputation: 24424
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.
Upvotes: 8