javascript - Why toggle effect not working for nested div using angular Directive -
i have attached plunker. unable access .gc
, .mc
element . although code working partially , class .bc
working expected. trying apply toggle effect on them , hierarchy wise
broadcategory > generalcategory > maincategory
not sure missing in
$(element).find('.gc').click( function() { alert('gc'); $(element).find(".mc").slidetoggle('200',function() { $(element).find("span").toggleclass('faqplus faqminus'); }); });
when angular links broadcategory div, generalcategory (ng-repeat)elements have not yet been created yet. click handler never added. add d-expand-collapse attribute .gc element. should see click alert fire.
<div d-expand-collapse ng-repeat="gen in group.items">
Comments
Post a Comment