Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng build --prod fails for AOT #130

Closed
critchie opened this issue Aug 8, 2017 · 2 comments
Closed

ng build --prod fails for AOT #130

critchie opened this issue Aug 8, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@critchie
Copy link

critchie commented Aug 8, 2017

ERROR in .../node_modules/ng2-pdf-viewer/dist/pdf-viewer.component.d.ts.PdfViewerComponent.html (5,12): Property 'onPageResize' is private and only accessible within class 'PdfViewerComponent'.

When using AOT, methods called from the template have to be public so "private onPageResize()" does not work with AOT.

See here

template: `
      <div class="ng2-pdf-viewer-container"
           [ngClass]="{'ng2-pdf-viewer--zoom': zoom < 1}"
           (window:resize)="onPageResize()"
      ></div>
  `,
  private onPageResize() {
    if (this.resizeTimeout) {
      clearTimeout(this.resizeTimeout);
    }

    this.resizeTimeout = setTimeout(() => {
      this.render();
    }, 100);
  }
@VadimDez VadimDez self-assigned this Aug 9, 2017
@VadimDez VadimDez added this to the 1.2.1 milestone Aug 9, 2017
@VadimDez VadimDez added the bug label Aug 9, 2017
@michal-filip
Copy link

Same here. Ended up downgrading to 1.1.5.

VadimDez added a commit that referenced this issue Aug 9, 2017
Closes #130, made onPageResize public
@critchie
Copy link
Author

critchie commented Aug 9, 2017

Works perfectly. Thanks for the quick turn around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants