Reputation: 39
i'm trying to make pdf viewer on brower with angular,but i got this error?
Upvotes: -1
Views: 1495
Reputation: 3022
As SOverflow mates said, it would be necessary that you show your code to be able to help you better.
So, while you add it, I will try to give you a solution based on the data you give, trying to "invent" how I think you have it set up.
<div #viewer>
<p>Whatever you have in your code div</p>
</div>
import { Component, OnInit, TemplateRef, ViewChild, AfterViewInit} from '@angular/core';
@ViewChild(‘viewer’) viewer!:ElementRef<HTMLDivElement>
// or, depending on your Angular version: @ViewChild(‘viewer’, {static: false}) viewer!:ElementRef<HTMLDivElement>
ngAfterViewInit() {
// Untill ngAftgerViewInit we don't have ViewChild value
let pdfViewer = new PDFViewer({
container: this.viewer;
viewer: this.viewer;
})
}
Upvotes: 0