sayanee / angularjs-pdf

:page_facing_up: An AngularJS directive <ng-pdf> to display PDF files with PDFJS

Home Page:http://sayan.ee/angularjs-pdf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

isolated scopes data-binding

Grigorius opened this issue · comments

If you are using for example http://angular-ui.github.io/bootstrap/#/modal which creates an isolated scope - then the pageNum attribute is no longer databinded.

To fix this issue I just moved pageNum one level deeper - so the pointer is referenced:
scope.pageData = {}; scope.pageData.pageNum = pageNum;

Also in the example:
Viewer.html has
<input type="text" min=1 ng-model="pageNum">
it should have (type and model changed)
<input type="number" min=1 ng-model="pageData.pageNum">

thanks @Grigorius! I will take a look into this.

Thanks for your suggestion! I have added this as part of tweaks / variations that can be used with this library by adding a note to the readme and linking it back to this issue.