Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular2-signaturepad

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-signaturepad

Angular2 Component wrapper for szimek / signature_pad

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.2K
decreased by-53.99%
Maintainers
2
Weekly downloads
 
Created
Source

angular2-signaturepad

Angular 2 component for szimek/signature_pad.

Install

npm install angular2-signaturepad --save

Usage example

API is identical to szimek/signature_pad.

Options are as per szimek/signature_pad with the following additions:

  • canvasWidth: width of the canvas (px)
  • canvasHeight: height of the canvas (px) The above options are provided to avoid accessing the DOM directly from your component to adjust the canvas size.
import { Component, ViewChild } from 'angular2/core';
import { SignaturePad } from 'angular2-signaturepad';

@Component({
  template: '<signature-pad [options]="signaturePadOptions" (onEndEvent)="doOnEnd()"></signature-pad>',
  directives: [SignaturePad]
})

export class SignaturePadPage{

  @ViewChild(SignaturePad) signaturePad: SignaturePad;

  private signaturePadOptions: Object = { // passed through to szimek/signature_pad constructor
    'minWidth': 5,
    'canvasWidth': 500,
    'canvasHeight'
  };

  constructor() {
    // no-op
  }

  ngAfterViewInit() {
    // this.signaturePad is now available
    this.signaturePad.set('minWidth', 5); // set szimek/signature_pad options at runtime
    this.signaturePad.clear(); // invoke functions from szimek/signature_pad API
  }

  doOnEnd() {
    // will be notified of szimek/signature_pad's onEnd event
    console.log(this.signaturePad.toDataURL());
  }
}

Keywords

FAQs

Package last updated on 21 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc