简体   繁体   中英

App can't find plugin file

I am trying to load insert this library into my ionic project: https://www.npmjs.com/package/ionic-native-transitions .

I ran the command to install the plugin:

ionic plugin add https://github.com/Telerik-Verified-Plugins/NativePageTransitions

I then inserted the dependency into my code, but it didn't work and reading this issue https://github.com/shprink/ionic-native-transitions/issues/29 I found out I needed to insert the script into my project so...

I have an index.html file located in:

frontend/www/index.html.

I have a js file I need located in:

frontend/node_modules/ionic-native-transitions/dist/ionic-native-transitions.js

I need to use this javascript file inside of my index.html file so I include it into my header:

<script src="../node_modules/ionic-native-transitions/dist/ionic-native-transitions.js"></script>

Inside of my IDE it says the path is valid and I can go to the declaration of this file inside of my IDE.

When I run the application, I get the following output in my console:

Failed to load resource: net::ERR_FILE_NOT_FOUND `file:///android_asset/node_modules/ionic-native-transitions/dist/ionic-native-transitions.js`

I am unsure why this is happening. How could I insert this script into my code then?

在此处输入图片说明

Turns out it is a problem with the plugin. I followed this tutorial now and I got it working: http://www.gajotres.net/handling-native-view-animations-with-ionic-framework/ . There is no requirement to load any scripts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM