legalthings / angular-signature

HTML5 canvas based smooth signature drawing as angularJS directive (http://szimek.github.io/signature_pad/)
MIT License
105 stars 91 forks source link

Signature plugin causes infinite $digest loop #73

Open thomaspaulb opened 6 years ago

thomaspaulb commented 6 years ago

Affected Angular versions: at least 1.5.7, 1.6.4

How to reproduce:

  1. Download demo code
  2. Add this snippet inside the main function in app.js:
    var nbDigest = 0;
    $rootScope.$watch(function() {
      nbDigest++;
      console.log('.');
    });
  1. Observe digest getting called indefinitely.

This is a problem in complex applications with many different elements on the screen, since the whole lot of it gets reevaluated multiple times per second and crashes the browser.

thomaspaulb commented 6 years ago

Also found the culprit.