Merott / nativescript-pdf-view

A basic PDF viewer plugin for NativeScript. Now maintained by @madmas: github.com/madmas/nativescript-pdf-view
Other
32 stars 35 forks source link

Cannot make it work with angular #17

Closed searleser97 closed 7 years ago

searleser97 commented 7 years ago

this is what I have

name.html ... <PDFView [src]="src" (load)="onLoad()"></PDFView> ...

name.component.ts ...

import "nativescript-pdf-view"
...
export class nameComponent {
    src = "https://www.princexml.com/samples/flyer/flyer.pdf";
    public onLoad() {
        alert('hi');
    }
}

...

It's just showing the alert but not the pdf.

Merott commented 7 years ago

Could you please verify if this issue still exists on the newly released version 2?

EddyVerbruggen commented 7 years ago

You may be missing the imports mentioned in the readme:

import { PDFView } from 'nativescript-pdf-view';
import { registerElement } from 'nativescript-angular';
registerElement('PDFView', () => PDFView);

And if it still doesn't appear you can try the flex layout mentioned in the readme, or as a quick check add width and height:

<PDFView width="200" height="200" [src]="src" (load)="onLoad()"></PDFView>
searleser97 commented 7 years ago

is good now