angular-event-delegate

Use a common parent to delegate events to underlaying DOM elements using jQuery
1 person uses it
Author: 461084?v=3 pocesar

angular-event-delegate

Use a common parent to delegate events to underlaying DOM elements using jQuery.

DEMO

Usage

How is it better than ng-click?

You can define, at once, many events besides click event, on the parent that will be delegated to the elements inside it.

Any new elements added to the parent will have the event bound without the need to binding a new event to it. Also useful with a big list of elements, having 100+ event listeners attached to each item, plus scope.$watch'es, starts to feel heavy. This is mainly useful in ng-repeat loops though.

You can define multiple selectors as well using for example 'click': '.showcase,.infotext'

Requirements

This depends on jQuery

comments powered by Disqus
This page was last updated almost 3 years ago.