0

AngularJs is a test driven framework.But jquery is not.Is using Jquery inside angular directives or anywhere in angularJs for dom manipulations correct way?because most of the plugins are available only for jquery.

For angular js needed to wrap all jquery plugins inside directives and applying that to dom elements.But it seems more time taking process when comparing to jquery's select and apply process.is there any way to overcome this problem?

sundar
  • 398
  • 2
  • 12

2 Answers2

0

I've used jQuery in custom directives before, but I try to avoid it if I can.

Check out the two questions below that have been asked on Stack Overflow. They provide great explanations on using jQuery with Angular that will answer your question.

"Thinking in AngularJS" if I have a jQuery background?

Should we use jQuery with AngularJS?

Community
  • 1
  • 1
  • without jquery how will you apply plugins like Datepicker or some other plugins only available for jquery in angularJs? – sundar Dec 26 '15 at 20:46
  • Most jQuery plugins have an AngularJS compatible directive. Google for it. In the case of Datepicker use https://angular-ui.github.io/bootstrap/#/datepicker – georgeawg Dec 26 '15 at 21:36
  • @georgeawg Angular v.2.0 has any solution for this? – sundar Dec 26 '15 at 21:46
0

You can use jQuery, in fact angular itself will use jQuery when it's available. You have to make sure you make all dom manipulations inside angular directives. Unfortunately, wrapping jQuery plugins to angular directives is time consuming, but the popular ones are already implemented. The tricky part is to wire all databinding properly.

Tamas Hegedus
  • 28,755
  • 12
  • 63
  • 97