angular-canvas-viewer icon indicating copy to clipboard operation
angular-canvas-viewer copied to clipboard

Cannot read property 'refresh' of null

Open Unlooper opened this issue 10 years ago • 8 comments

Hi, I'm having some problems integrating the library:

Cannot read property 'refresh' of null
    at Object.fn (CanvasViewer.all.min.js:35)

This occurs the first time that model is assigned to src attribute and it is not defined with a file...

It is placed in the non minified code at line 172:

scope.$watch('options.controls.filmStrip', function(position) {
    if (position) {
           scope.options.controls.disableMove = true;
        scope.options.controls.disableRotate = true;
    } else {
        scope.options.controls.disableMove = false;
        scope.options.controls.disableRotate = false;
    }
    reader.refresh();
});

Other thing is a weird effect, some kind of vertical scroll growing for a time...

Do you know something about this?.

Thank you very much!

Unlooper avatar Mar 17 '16 16:03 Unlooper

Hi, Yes i ve done a comit, can you try again, and if you have a simple case to reproduce any other issue

Thanks

fcrohas avatar Mar 17 '16 23:03 fcrohas

Hi, thank you very much for your work.

I'm still having the same problem:

When the workflows gets into 'options.controls.filmStrip', reader is undefined, so when it tries to access to the refresh property of undefined, an exception is thrown. I think this is due to in that moment, my file model is undefined and therefore, workflows doesn't get to 'imageSource' watcher and reader is not initializated.

Thank you very much!

Unlooper avatar Mar 18 '16 07:03 Unlooper

Hi,

Do you have a sample code to reproduce the issue ?

Fabrice,

fcrohas avatar Mar 18 '16 08:03 fcrohas

I am facing the same issue. Any resolution @Unlooper @fcrohas

pranjal-goswami avatar Aug 31 '16 11:08 pranjal-goswami

I find this happens when I try to assign my fileInput = resp.data on a get call

jmsunseri avatar Jan 26 '17 20:01 jmsunseri

Hello, I have the same problem in my application, also with property value and zoom, Has anyone found a solution to this problem? Cannot set property 'value' of undefined http://localhost:9966/js/shared/CanvasViewer.js:117:30 Cannot read property 'refresh' of null http://localhost:9966/js/shared/CanvasViewer.js:179:15

aleDaniel00 avatar Feb 13 '17 16:02 aleDaniel00

Solved the problem by commenting the following line in the controller $scope.options={controls:{toolbar:!0,fit:"width"}}

aleDaniel00 avatar Feb 13 '17 21:02 aleDaniel00

having the same problem

thaisanly avatar Jul 26 '18 04:07 thaisanly