I'm using AngularJS and I just want to copy an image from whatever (can be snipping tool) and ctrl+v or paste into a canvas so I can upload to the database.
Can anyone explain me how to do this without Jquery? I would like to not lose the aspect ratio if possible
Edit: I just want to have the signature object filled to send to the API. ticket_id
is a number and signature
is a blob or byte[]
Surely, there's a simpler way. Otherwise, I'm better off using jquery -.-
this.signature = {
ticket_id: null,
signature: null
};
this.uploadSignature = function() {
// Fill signature object ???
console.log(this.signature);
$http.post(baseUrl + "/signature", this.signature).then(
function(response) {
// success callback
console.log("Signature Submitted!");
},
function(response) {
// failure call back
console.log("Error while submitting the comment");
});
}
.signatureCanvas {
width: 100%;
background: #ddd;
}
<div class="signature-div text-center">
<canvas class="signatureCanvas"></canvas>
<div class="text-right">
<button uib-tooltip="Upload Signature" class="btn btn-default">Upload <i class="glyphicon glyphicon-cloud-upload"></i></button>
</div>
</div>