javascript - ng-click with parameter not working inside dynamic template -
i'm using angularui bootstrap library in project. in particular, i'm using accordion , custom template display accordion groups etc. on template have ng-click event seems working when don't have parameter on it. inside directive have scope variable produces unique identifier have included parameter on ng-click event. missing working? i'm using angular 1.0.8.
thanks in advance
!-- template
<a callback="accordion_group_opened($index)" ng-click="callsubmit(currentrow)">
!-- scope variable incremented each time directive called
countrow = generateunique.getnextidstartingatone(); scope.currentrow = countrow;
edit:
added compilation still not getting value scope ng-click param. ideas on work around?
compile:function (scope, element, attrs) { var countrow = generateunique.getnextidstartingatone(); scope.currentrow = countrow; return function(scope, element, attr) { $timeout(function() { var fn = $parse(attr["ngclick"]); element[0].on("click", function(event) { scope.$apply(function() { fn(scope, {$event:event}); }); }); }) }; }
Comments
Post a Comment