1

i want to implement Angular JS, Angular JS UI plugins and bootstrap in my ASP MVC 5 apps. Some people say Jquery is still in use in Angular JS part, so could any one here please explain when and where i would need to use JQuery in Angular Js code?

1 Answer 1

1

Angular doesn't include jQuery but a light-weight plugin called jq-lite. This provides a lot of the methods that jQuery does, but not all of them.

It specifically has to do with Angular.element. You can take a look at the documentation here

https://docs.angularjs.org/api/ng/function/angular.element

jqLite is a tiny, API-compatible subset of jQuery that allows Angular to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most commonly needed functionality with the goal of having a very small footprint.

Basically, there are a couple of pointers to keep in mind

  1. Keep all DOM logic outside of the controllers. Use custom directives on attributes for that.
  2. Instead of simulating mouse events, use their angular counterparts. Examples include ng-click and ng-mouseover. Add these directives to the elements in the form of attributes.
  3. Instead of adding classes, use ng-class
  4. If you are using jquery or jqlite, be sure to include the jquery script before the angular script.
Sign up to request clarification or add additional context in comments.

2 Comments

is it recommended to use Angular JS with Jquery 'cus if all things that were done using JQuery now can be done with Angular JS then is there a good professional reason to dwell in Jquery
I'd opt against it. See this post stackoverflow.com/questions/14994391/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.