添加依赖项到我的入门应用程序的空白页面

时间:2016-02-13 16:47:49

标签: javascript angularjs ionic-framework

我是离子框架的新手,并试图将ngPDFViewer放到我的应用程序中。 我得到的错误是

Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
Error: [$injector:modulerr] Failed to instantiate module ngPDFViewer due to:
Error: [$injector:nomod] Module 'ngPDFViewer' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

我做什么

在index.html中

<!-- ionic/angularjs js -->

<script src="lib/ionic/js/ionic.bundle.js"></script>
    <script src="lib/pdf.compat.js"></script>
    <script src="lib/pdf.js"></script>
    <script src="lib/ng-pdfviewer.js"></script>

<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>

<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>

在app.js

angular.module('starter', ['ionic', 'ngPDFViewer', 'starter.controllers', 'starter.services'])

有关ngPDFViwer的更多信息,请访问:

https://github.com/akrennmair/ng-pdfviewer/

0 个答案:

没有答案