$scope.accept = function () {
var signature = {};
if (!$scope.signaturePad.isEmpty()) {
signature.isEmpty = false;
} else {
signature.dataUrl = EMPTY_IMAGE;
signature.isEmpty = true;
}
return signature;
};
...
should be
$scope.accept = function () {
var signature = {};
if (!$scope.signaturePad.isEmpty()) {
signature.isEmpty = false;
//WHY WAS THIS MISSSING?!?!?!?!
signature.dataUrl = $scope.signaturePad.toDataURL("image/gif");
} else {
signature.dataUrl = EMPTY_IMAGE;
signature.isEmpty = true;
}
return signature;
};
So the scope item which is set equal to the directive's 'accept' attribute would be only {isEmpty = false}. With the change above, That line was in the code but someone took it out in an update. For the life of me, I could not figure out why, because the directive loses half of its functionality.
You have a massive typo FYI. In the definition of $scope.accept you have ( commit https://github.com/legalthings/angular-signature/commit/df28083f41b557184f340cb26765881b8eb253ec for reference )
...
should be
So the scope item which is set equal to the directive's 'accept' attribute would be only {isEmpty = false}. With the change above, That line was in the code but someone took it out in an update. For the life of me, I could not figure out why, because the directive loses half of its functionality.