There is no incompatibility between jQuery and Angular, in fact Angular
itself will make use of jQuery if it is available. See the docs for
angular.element <http://docs.angularjs.org/api/angular.element>.

It's considered best practice to keep your DOM aware code within directives
- though I don't think that's actually what OP was getting at when he says
"controller". So I guess I'd say within your own application do whatever
you think is best :) it really comes down to convenience vs bloat vs
dependency control - and that's a decision you'll have to make. If you're
publishing a module on the other hand... obviously staying within the
framework becomes more desirable.


----------------------------------------------------------------
jrussell.me


On Wed, Feb 5, 2014 at 8:47 AM, calvin <[email protected]> wrote:

> A core idea and goal with Angular is to avoid DOM manipulation where
> possible, but I can see that being difficult for some things. So for any
> part of the DOM that you want manipulated then you will assign a controller
> to control it.
> Not thought about how if this works with adding DOM elements on the fly
> though in theory they ought to work fine. Still as Michael says it does
> come with jqLite and hopefully this can deal with what you need for after
> that I would say you can manage with plain js.
>
> From: Michael Hopper <[email protected]>
> Reply-To: <[email protected]>
> Date: Wed, 5 Feb 2014 05:43:25 -0800 (PST)
> To: <[email protected]>
> Subject: [AngularJS] Re: Should use jquery with angularjs ??
>
> AngularJS comes with a trimmed down version of jQuery (called jqLite) but
> you can use a full version if needed. The AngularJS way it to put your DOM
> manipulation code inside of AngularJS directives. Inside the directive code
> it is perfectly acceptable to use jQuery as the means of doing the DOM
> manipulation, it just needs to be wrapped inside a directive and follow the
> best practices for writing directives.
>
> On Tuesday, February 4, 2014 6:50:49 PM UTC-5, biloki wrote:
>>
>> Hi everyone,
>>
>> I have a question very base: should we use jquery in the app that use
>> angularjs ? If not, what should we use as the controller of DOM ?
>>
>> Thank you very much
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/kxQAYzAsntI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
>
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to