Ionic framework ionic-如何设置DocumentViewer以显示在Ionion内容中
我对离子型和棱角型很陌生。我已经正确设置了ionic,创建了我的应用程序“myApp”,并安装了我想要使用的DocumentViewer插件。我甚至通过以下代码将其导入我的app.module.ts和app.component.ts中:Ionic framework ionic-如何设置DocumentViewer以显示在Ionion内容中,ionic-framework,documentviewer,Ionic Framework,Documentviewer,我对离子型和棱角型很陌生。我已经正确设置了ionic,创建了我的应用程序“myApp”,并安装了我想要使用的DocumentViewer插件。我甚至通过以下代码将其导入我的app.module.ts和app.component.ts中: import { DocumentViewer} from '@ionic-native/document-viewer' 它甚至加载到提供程序阵列中: providers: [ DocumentViewer, StatusBar,
import { DocumentViewer} from '@ionic-native/document-viewer'
它甚至加载到提供程序阵列中:
providers: [
DocumentViewer,
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
apps.component.ts代码:
constructor(public document: DocumentViewer, platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
this.document.viewDocument('../assets/Mary.pdf', 'application/pdf');
});
}
问题是如何在我创建的详细信息页面中显示文件?我在谷歌上搜索过,但没有相关的答案对我有帮助。谢谢你的帮助
My details.html页面:
<ion-header>
<ion-navbar>
<ion-title>{{item.text}}</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<h2>Welcome #{{item.id}}</h2>
<p>
Great job!
</p>
</ion-content>
{{item.text}
欢迎{{item.id}
干得好!
大家好,我也遇到了同样的问题。你有这个问题的解决方案吗?这里一样,没有相关的解决方案,同样的错误文档还没有,不知道为什么有人可以回答