【发布时间】:2017-07-13 10:56:01
【问题描述】:
我正在使用angular2-signaturepad。
我正在尝试验证签名板。 像这样
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();
}
}
这是我的savepad() 函数。
我想要这种功能:
如果签名板是空的(不带签名保存),祝酒词“你必须先签名”。 否则会保存成功。
这可以验证 angular2-signaturepad 吗?
或
我是不是做错了什么?
如果可能的话 请指导我..!!
【问题讨论】:
-
应该是什么问题?您能更具体地说明您要做什么吗?
-
如果签名板是空的(不带签名保存)吐司要来“你必须先签名”。否则会保存成功。
标签: javascript angular ionic2 signaturepad