Giter Site home page Giter Site logo

peeedge / angular-signature Goto Github PK

View Code? Open in Web Editor NEW

This project forked from legalthings/angular-signature

0.0 2.0 0.0 37 KB

HTML5 canvas based smooth signature drawing as angularJS directive (http://szimek.github.io/signature_pad/)

License: MIT License

JavaScript 100.00%

angular-signature's Introduction

Angular Signature

Scrutinizer Code Quality

AngularJS directive for the signature pad JavaScript library by szimek.

In contrast to other AngularJS directives for szimek's signature pad, this directive does not apply any styling. The directive only places the canvas and allows you to bind your app to the signature pad by binding the functions in the scope of your controller. This means you can call them from your own (custom) buttons.

sign animation

Demo

An online demo of the directive can be found here.

Installation

Install this module using bower

bower install angular-signature --save

or install this module using npm

npm install angular-signature --save

Add the module to your app

angular.module('app', [
  'signature',
]);

Usage

Basics

<signature-pad accept="accept" clear="clear" height="220" width="568" disabled="false"></signature-pad>
<button ng-click="clear()">Clear signature</button>
<button ng-click="signature = accept()">Sign</button>

Bootstrap Modal

This plugin works well in a Angular UI Bootstrap Modal.

angular.module('app').controller('SignModalCtrl', [
  '$scope', '$modalInstance'
  function ($scope, $modalInstance) {
    $scope.done = function () {
      var signature = $scope.accept();

      if (signature.isEmpty) {
        $modalInstance.dismiss();
      } else {
        $modalInstance.close(signature.dataUrl);
      }
    };
  }
]);
<div class="modal-header">
    <h3 class="modal-title">Sign</h3>
</div>
<div class="modal-body">
    <signature-pad accept="accept" clear="clear"></signature-pad>
</div>
<div class="modal-footer">
    <button class="btn btn-default pull-left" ng-click="clear()">Clear signature</button>
    <button class="btn btn-default" ng-click="$dismiss()">Cancel</button>
    <button class="btn btn-primary" ng-click="done()">Sign</button>
</div>

angular-signature's People

Contributors

ahmehri avatar barryvdh avatar dwerner90 avatar jamesguthrie avatar jasny avatar jonsnaka avatar kfprimm avatar masterbrowser avatar moesjarraf avatar polinom avatar qodot avatar sarfaraaz avatar slickrick1983 avatar subdee avatar tendentious avatar tommaitland avatar yhorbachov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.