Skip to content
This repository was archived by the owner on Jun 15, 2024. It is now read-only.

Cannot make it work with angular #17

Closed
searleser97 opened this issue Apr 13, 2017 · 3 comments
Closed

Cannot make it work with angular #17

searleser97 opened this issue Apr 13, 2017 · 3 comments

Comments

@searleser97
Copy link

searleser97 commented Apr 13, 2017

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 added a commit that referenced this issue May 21, 2017
This release is almost a full rewrite and fixes a number of issues as well as being made compatible with NativeScript 3.

Close #8, close #15, close #16, close #18. Also related is #17.

BREAKING CHANGE: The plugin no longer auto-registers a tag in Angular applications. Instructions to register a `PDFView` element have been added to the project README.
@Merott
Copy link
Owner

Merott commented May 21, 2017

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

@EddyVerbruggen
Copy link
Contributor

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>

@Merott Merott closed this as completed Jun 7, 2017
@searleser97
Copy link
Author

is good now

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

No branches or pull requests

3 participants