I am new to hybrid applications and developing an application using Ionic framework in which I would like to implement a multiple signature pad inside ng-repeat
. The canvas is displayed with the defined css specifications.But,the drawing the signature is not working.
signature.html
<div ng-repeat="esign in consent" >
<div ><!--Signature Pad -->
<canvas id="{{'canvas'+$index}}" ng-init="createSigPad($index)" width='300' height='180' style='border: 1px solid blue;'></canvas>
<div class='button-bar'>
<a class='button button-energized' >Clear</a>
<a class='button button-balanced' >Save</a>
</div>
</div>
</div>
controller.js
$scope.createSigPad=function(index){
// alert(document.getElementById('canvas'+index).id);
new SignaturePad(document.getElementById('canvas'+index));
}
In the Logcat I see the line TypeError: Cannot call method 'getContext' of null
Note: It is working fine when I tried a single Signature pad outside of ng-repeat
Please help me finding the solution.