npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-sign-here

v1.0.1

Published

AngularJS signature pad component

Downloads

5

Readme

ng-sign-here

AngularJS signature capture component. Wrapper for signature_pad.

Install

npm install ng-sign-here

Getting Started

Include ngSignHere.min.js and signature_pad.

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/signature_pad.min.js"></script>
<script src="../dist/ngSignHere.min.js"></script>

Add as a module dependency.

angular.module('demoApp', ['ngSignHere']);

Use the component in html.

<sign-here></sign-here>

Examples

Adding the component in html isn't very useful by itself. You can draw on the canvas, but that's about it.

Size

To set the signature pad size, simply add a css class or inline style. The signature pad will size itself to fit.

<sign-here style="width: 600px; height: 300px;">
</sign-here>

Background Color

Set the background color using background-color. Defaults to transparent. Supports hex, rgb/rgba, and color names.

<!-- Sets background color to black -->
<sign-here background-color="#000000">
</sign-here>

Pen Color

Set the pen color using pen-color. Defaults to a dark blue. Supports hex, rgb/rgba, and color names.

<!-- Sets pen color to green -->
<sign-here pen-color="#6BD425">
</sign-here>

Image Format

Set the returned image format using image-format. Defaults to png. Supported formats are png, jpg/jpeg, and svg.

<!-- Sets image format to svg -->
<sign-here image-format="svg">
</sign-here>

Getting the Signature

Pass a function to on-signature-update.

// Controller signature update function.
ctrl.onSignatureUpdate = function (signatureData) {

    // Set a signatureData property on your controller.
    ctrl.signature = signatureData;
};
<sign-here on-signature-update="demo.onSignatureUpdate">
</sign-here>

Clearing the Signature

This component does NOT use two-way binding, so you need to register a handler with register-clear-handler. On clear, the component will call onSignatureUpdate with undefined.

// Your controller's clear handler.
let clearSignatureHandler = null;

// Register clear handler function.
ctrl.registerClearHandler = function (handler) {

    // Set the handler returned from the component.
    clearSignatureHandler = handler;
};

// Handle the clear button click.
ctrl.clearSignature = function () {

    // Check if a the clearSignatureHandler is registered.
    if (clearSignatureHandler) {

        clearSignatureHandler();
    }
};
<!-- Register your controller's clear handler -->
<sign-here demo.registerClearHandler(handler)>
</sign-here>

<!-- A clear button somewhere on your page -->
<button ng-click="demo.clearSignature()">
    CLEAR
</button>