From 42a266d1e55540384db05c52334ed8a48ebb6d4a Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 6 Dec 2013 13:56:14 -0600 Subject: [PATCH 1/5] added current steps --- README.md | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f11718..63f44dc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,44 @@ ngSignaturePad +=== -SignaturePad as an angularJS directive \ No newline at end of file +SignaturePad as an angularJS directive + +Install +=== + +The install process is a little more manual right now... + +```bash +bower install -S signature_pad +bower install https://raw.github.com/marcorinck/ngSignaturePad/master/ngSignaturePad.js + +pushd app/bower_components/ngSignaturePad +wget https://raw.github.com/marcorinck/ngSignaturePad/master/ngSignaturePad.min.css +popd +``` + +Include the script tags + +```html + + +``` + +Use the directive somewhere in your html as an *attribute* + +```html +
+``` + +Then add the module to your list of angular dependencies as `ngSignaturePad` + +``` +angular.module('myDemoApp', [ + 'ngCookies' + , 'ngResource' + , 'ngSanitize' + , 'ui.bootstrap' + , 'ui.router' + , 'ngSignaturePad' + ]) +``` From 5ede05c60fbcd81e85c57e726a081304bcdb089b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 6 Dec 2013 14:06:58 -0600 Subject: [PATCH 2/5] added missing script tag for the main library --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 63f44dc..79004ec 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Include the script tags ```html + ``` From 917357cb6ea11ec1cbd1df842fbaf725cf89bbb7 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 6 Dec 2013 14:11:37 -0600 Subject: [PATCH 3/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 79004ec..2653bfc 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Include the script tags Use the directive somewhere in your html as an *attribute* ```html -
+
``` Then add the module to your list of angular dependencies as `ngSignaturePad` From e689a20199f37eab200d9f8e9764c9d6c6beeaf3 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 6 Dec 2013 14:15:10 -0600 Subject: [PATCH 4/5] Fixed get(0) -> [0] I get an exception when I use `canvas.get(0)`. Maybe it's just an angular 1.0.x / 1.2.x thing, but probably better to go with the one that works everywhere, right? --- src/SignaturePadDirective.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SignaturePadDirective.js b/src/SignaturePadDirective.js index c44d56e..833c12d 100644 --- a/src/SignaturePadDirective.js +++ b/src/SignaturePadDirective.js @@ -75,7 +75,7 @@ angular.module("ngSignaturePad").directive('signaturePad', function ($window) { canvas = $element.find("canvas"); scope = $scope; element = $element; - signaturePad = new SignaturePad(canvas.get(0)); + signaturePad = new SignaturePad(canvas[0])); setCanvasHeightAndWidth(); @@ -84,4 +84,4 @@ angular.module("ngSignaturePad").directive('signaturePad', function ($window) { } } }; -}); \ No newline at end of file +}); From a95f3ff3fd487b51173b357456ea978473d65b7d Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 6 Dec 2013 14:15:57 -0600 Subject: [PATCH 5/5] applied same get(0) -> [0] fix to built file --- ngSignaturePad.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ngSignaturePad.js b/ngSignaturePad.js index 32dd0e3..a786ea1 100644 --- a/ngSignaturePad.js +++ b/ngSignaturePad.js @@ -67,7 +67,7 @@ angular.module('ngSignaturePad').directive('signaturePad', [ canvas = $element.find('canvas'); scope = $scope; element = $element; - signaturePad = new SignaturePad(canvas.get(0)); + signaturePad = new SignaturePad(canvas[0])); setCanvasHeightAndWidth(); if ($scope.signature && !$scope.signature.$isEmpty && $scope.signature.dataUrl) { signaturePad.fromDataURL($scope.signature.dataUrl); @@ -75,4 +75,4 @@ angular.module('ngSignaturePad').directive('signaturePad', [ } }; } -]); \ No newline at end of file +]);