I am Using angular2-signaturepad.
I am trying to validate the signature pad. like this
savePad() {
this.signature = this.signaturePad.toDataURL();
if (this.signature != '' && this.signature == undefined) {
// this.signature = this.signaturePad.toDataURL();
this.signature = '';
let toast = this.toastCtrl.create({
message: 'You have to Signature first.',
duration: 3000,
position: 'c'
});
toast.present();
}else{
this.signaturePad.clear();
let toast = this.toastCtrl.create({
message: 'New Signature saved.',
duration: 3000,
position: 'top'
});
toast.present();
}
}
this is my savepad()
function.
I want this kind of functionality:
If signature pad is empty(save without signature) the toast want to come "You have to Signature first." else it will save successfully.
Is this Possible to validate angular2-signaturepad ?
or
am I doing something wrong ?
if is possible then please guide me ..!!