html - Angularjs: How to Call canvas id in ng-data-repeat in my Controller? -
i want make multiple canvas; id of canvas "signaturecanvas + index" in html controller output null. why console.log(canvas); null? put id html? pls me guys!.
<div data-ng-repeat="signaturepadpreparedby in signaturepadobjectpreparedby track $index"> <ion-item> <div class="spacer" style="height:25px;width:100%"></div> <div id="signaturecanvasdiv" class="row responsive-sm"> <div class="col row responsive-sm sgn" id="canvas_container"> <canvas id="{{'signaturecanvas'+$index}}"></canvas> </div> </div> </ion-item> <div ng-init="getclass($index)"></div> </div>
here controller
$scope.getclass = function (i) { console.log("output"); var canvas = document.getelementbyid('signaturecanvas' + i); console.log(canvas); signaturepad[i] = new signaturepad(canvas) };
ouput : null
canvas null;
Comments
Post a Comment