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

PDFView is not imported by default {N} + angular (nativescript@2.5.2) #15

Closed echap closed 7 years ago

echap commented 7 years ago

Hi,

Just to inform you that the PDFView is not correctly imported on the project, adding this snippet on main.ts solves the issue :

import {registerElement} from "nativescript-angular/element-registry";
registerElement("PDFView", () => require("nativescript-pdf-view").PDFView);

with nativescript@2.5.2

Cheers,

imaginationcoder commented 7 years ago

Still I am getting below error

npm run start-android-bundle Module not found: Error: Can't resolve 'nativescript-pdf-view' in '/Users/maisapride7/workspace/KIDSAPP/tingr-ns-app/app'

and app.module.ts contains

registerElement("PDFView", () => require("nativescript-pdf-view").PDFView);

Merott commented 7 years ago

I just released version 2 of this plugin, and have removed the auto-registration of the PDFView element. It's now required to manually do so in your own applications.