I have an app with Angular Signature directive.
This directive allow you draw a sign in a canvas, the content of this canvas is rendered in a <img>
tag (base64)
<div class="container">
<signature-pad
accept="accept" clear="clear"
height="220" width="568"
dataurl="dataurl">
</signature-pad>
<div class="buttons">
<button ng-click="signature = accept()">Generate</button>
</div>
</div>
<div class="result" ng-show="signature">
<img ng-src="{{signature.dataUrl}}" />
</div>
The image base64 is in {{signature.dataUrl}}
, The image base64 it is generated very fine.
I want to pass value of ng-src to ng-model. I tried to do this.
<div class="result" ng-show="signature">
My ng-model (in my controller) : {{mySign}}
<img ng-model="mySign" ng-src="{{signature.dataUrl}}" class="imagen-firma" />
</div>
In my controller I have initialized:
$scope.mySign = "";
But the value of ng-src (base64) not pass to my ng-model. How can I do that?