Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 886 Bytes

README.md

File metadata and controls

47 lines (34 loc) · 886 Bytes

ngx-sign-pad

ngx-sign-pad is an Angular wrapper for szimek/signature_pad.

Usage

1. Install

npm install ngx-sign-pad --save

2. Import SignaturePadModule

import { SignPadModule } from 'ngx-sign-pad';

...

@NgModule({
  declarations: [ ],
  imports: [ SignPadModule ],
  providers: [ ],
  bootstrap: [ AppComponent ]
})

3. Use ngx-sign-pad

import { Component, ViewChild } from '@angular/core';
import { EImageType, SignPadComponent } from 'ngx-sign-pad';

@Component({
  template: '<ngx-sign-pad [(signature)]="signature" [type]="imageTypes.SVG"></ngx-sign-pad>'
})

export class AppComponent{

  imageTypes = EImageType;
  signature = null;
  @ViewChild(SignPadComponent) signaturePad: SignPadComponent;
  
  constructor() {
  }

  clear() {
    this.signaturePad.clear();
  }
}