jdryg / angular-pdf-viewer

Just another Angular directive for displaying PDF files using PDF.js

Home Page:http://jdryg.github.io/angular-pdf-viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Line 466. $scope.$apply inside $digest

jdryg opened this issue · comments

Sometimes when scrolling, updating the current page index inside $apply (line 466) reports an error. If I remove the $apply call, then the page isn't always updated!

Fixed by returning the current page ID from renderAllVisiblePages and setting the scope var correctly depending on whether we are inside a $digest turn (onPDFScaleChanged) or a normal js turn ($element.bind("scroll")).