Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49229

TypeError: Cannot call method 'getContext' of null in Signature App

$
0
0

@eslazyk wrote:

I am trying to insert a Signature pad into my App. The Signature logic works in plain HTML, but not when used with Ionic. I am New to this stuff, so if you have an answer, please explain clearly. Here is my code:

In my index.html:
<script src="js/signature_pad.js"></script>
<script src="js/app.js"></script>

In the app.js:
var canvas = document.getElementById('signatureCanvas');
signaturePad = new SignaturePad(canvas);

In my signature.html:
<canvas id='signatureCanvas' width='300' height='180'></canvas>

I have read that it is because the DOM is not done loading before it tries to create the Signature canvas, and that I should move my logic "inside a function" or use "Jquery", but I do not know how to do this, and have not found any good examples. If you know how to do this, please teach me how.

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>