jqLite equivalent of 'element.empty'? Is 'element.children().remove()' safe?

1,820 views
Skip to first unread message

richard.kenna...@gmail.com

unread,
Dec 8, 2012, 3:13:26 PM12/8/12
to ang...@googlegroups.com
Hi guys,

Thanks for doing an amazing job with Angular!

I note that Angular's jqLite's 'element'...

...does not support JQuery's 'element.empty()'...

...what is the equivalent? I tried 'element.children().remove()' and that seems to work, but I'm worried that is inefficient? In particular JQuery talks about using .empty() to "avoid memory leaks". Is 'children().remove()' safe to use?

Regards,

Richard.

Alex Ford

unread,
Mar 5, 2014, 5:41:48 PM3/5/14
to ang...@googlegroups.com
Couple years late, but this question showed up as the first result from my Google search so here you go:

    angular.element(someElem).html('');

Richard Kennard

unread,
Mar 5, 2014, 5:43:57 PM3/5/14
to ang...@googlegroups.com
Yeah, bit late now I'm afraid. But thanks for helping. Always great to contribute to the community.


--
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/S2W4XIyo4oQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages