Comments (10)
Removing the inputs: ['options']
in the component declarations makes this work for me through npm
from angular2-signaturepad.
@sovanyio could you share the relevant code you used to invoke the signature pad please?
Ours looks like this:
controller
// snip
@Component({
templateUrl: 'build/checkin/signaturePad/signaturePad.html',
directives: [Button, SignaturePad]
})
// snip
public signaturePadOptions: Object = {
canvasWidth: 800,
canvasHeight: 500
};
// snip
public doOnEnd(): void {
this.valid = !this.signaturePad.isEmpty();
}
template
<!-- snip -->
<signature-pad [options]="signaturePadOptions" (onEndEvent)="doOnEnd()"></signature-pad>
from angular2-signaturepad.
controller
import { Component, ViewChild, forwardRef } from '@angular/core';
import { SignaturePad } from 'angular2-signaturepad';
import { NG_VALUE_ACCESSOR, REACTIVE_FORM_DIRECTIVES } from '@angular/forms';
/*
Generated class for the SignatureField component.
See https://angular.io/docs/ts/latest/api/core/ComponentMetadata-class.html
for more info on Angular 2 Components.
*/
@Component({
selector: 'signature-field',
templateUrl: 'build/components/signature-field/signature-field.html',
directives: [
REACTIVE_FORM_DIRECTIVES,
SignaturePad
],
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => SignatureField),
multi: true
}
]
})
export class SignatureField {
@ViewChild(SignaturePad) signaturePad: SignaturePad;
options: Object = {};
_signature: any = null;
propagateChange = (_: any) => {};
get signature() {
return this._signature;
}
set signature(value) {
this._signature = value;
this.propagateChange(this.signature);
}
writeValue(value: any) {
this.signaturePad.fromDataURL(value);
}
registerOnChange(fn: any) {
this.propagateChange = fn;
}
registerOnTouched() {}
ngAfterViewInit() {
this.signaturePad.clear();
}
drawComplete() {
this.signature = this.signaturePad.toDataURL();
}
}
template
<signature-pad [options]="options" (onEndEvent)="drawComplete()"></signature-pad>
from angular2-signaturepad.
Thanks a lot, will give it a whirl this coming week and see if I can replicate what you're seeing.
Off topic, what are you using to generate the controller class definition?
from angular2-signaturepad.
The ionic2 cli
from angular2-signaturepad.
Sorry for the delayed response, I've been pretty busy with work this week.
I've done my best to implement your changes verbatim to my demo project, and cannot replicate the issue you've reported.
https://github.com/lathonez/clicker/compare/signaturepad-7?expand=1
Can you replicate the error on this branch? Your signature-field component is on a form in the second page ("Goodbye Ionic").
from angular2-signaturepad.
Ah I feel silly, I was super behind somehow on 1.0.4. Not sure how that happened. Anyway, closing. Thanks!
from angular2-signaturepad.
hi all,
could you please provide an example for 2 signature-pad instances setting different values from different data URLs?
Thanks!
from angular2-signaturepad.
You are very unlikely to get helpful responses from anyone by posting on closed issues.
from angular2-signaturepad.
Sorry! BTW thanks for your reply!
from angular2-signaturepad.
Related Issues (20)
- [Ionic]: Signature Pad focus issue for iOS devices (issue A11y) HOT 1
- [ERROR] Build with angular/[email protected] HOT 2
- is there a regression of Fix #94 ? HOT 1
- Compilation issue, gives module has no exported member 'SignaturePadModule' HOT 3
- ERROR in src/app/components/modals/modals.module.ts(15,10): error TS2305: Module '"../../../../node_modules/angular2-signaturepad/angular2-signaturepad"' has no exported member 'SignaturePadModule'. HOT 3
- this.sigaturePad.set('canvasWidth', value) giving error HOT 4
- Signature pad issue on iOS 12 Device HOT 1
- Update to Angular 13 HOT 14
- Outdated peer dependency warnings
- Voiceover in IOS completely ignores the signature pad.
- Error: Module not found: Error: Can't resolve 'signature_pad' (v4.0.1 with Angular v13 Error) HOT 3
- Getting correct mouse offset on scale
- Memory Leaks HOT 1
- Ivy/Angular9 Compatibility (Symbol is not exported)
- OnResize window canvas height increase constantly independent of screen size HOT 4
- 'node_modules/angular2-signaturepad/index.ts' not found
- iOS/safari canvas memory leak
- `Cannot read property 'offsetWidth' of undefined` on resizeCanvas HOT 2
- Upgrade to angular 8+ HOT 5
- Signature with Text HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular2-signaturepad.