Last Updated: February 25, 2016
·
564
· kazimanzurrashid

AngularJS and jQuery

The Idiomatic way to write code in angular is not to use any dom in your controller(it makes writing tests hard), if you have some common reusable or complicated dom manipulation code, you are suppose to create directive for it. Angular comes with a lightweight version of jQuery which is called jQuery lite, if angular finds jQuery is included it would use it rather than its built-in jQuery lite. In ideal world your directive should only have code that is supported in jQuery lite, but in that case you will be missing the big ecosystem of jQuery, so my suggestion is to create directive which should act as thin wrapper of those jQuery plug-ins that you want to use in your app.