I need to access element (dom) with id in a jQuery function, element is inside ng-repeat
of Angular (generating dynamic id for each element), and we are calling a jQuery function in element ng-bind
or ng-init
.
Code:
<div class="row bottom-border" ng-repeat="test in tests">
<div class="col-xs-2 label-value">
<div class="canvas-wrap-task">
<canvas id="canvaspending{{$index}}" width="50" height="50"
ng-bind="drawRequestCountCircles(test.Total, test.Pending, 'canvaspending{{$index}}','')">
</canvas>
</div>
</div>
</div>
In ng-init dom is not getting prepared so the element is being returned as null in function.
And if we use ng-bind
everything is working but jQuery method is called multiple times.
Please help us resolve this.