andrewmcgivery / ionic-ion-autoListDivider

Gives a set of directives for automatically adding in list dividers for an ng-repeat. (Works for Alphabetical or by Categories)
75 stars 21 forks source link

Adding ng-click events to the dividers #9

Open samuelgoldenbaum opened 9 years ago

samuelgoldenbaum commented 9 years ago

How do I bind ng-click events to the newly inserted dividers?

I add: ng-click='clicked()' to:

var contentTr = angular.element("<div ng-click='clicked()' class='item item-divider'>"+divideKey+"</div>");

yet it doesn't fire in the directives scope:

     scope.clicked = function() {
        alert('clicked');
      }

http://codepen.io/samuelgoldenbaum/pen/mJJvqw