I am trying to load insert this library into my ionic project: https://www.npmjs.com/package/ionic-native-transitions.
我正在尝试将此库加载到我的离子项目中: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...
然后我将依赖项插入到我的代码中,但它没有工作并阅读此问题https://github.com/shprink/ionic-native-transitions/issues/29我发现我需要将脚本插入到我的项目中所以...
I have an index.html file located in:
我有一个index.html文件位于:
frontend/www/index.html.
I have a js file I need located in:
我有一个我需要的js文件:
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:
我需要在我的index.html文件中使用这个javascript文件,所以我将它包含在我的标题中:
<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.
在我的IDE内部,它说路径是有效的,我可以在我的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?
我不确定为什么会这样。我怎么能把这个脚本插入我的代码呢?
1 个解决方案
#1
0
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.
原来这是插件的问题。我现在已经按照本教程进行操作了:http://www.gajotres.net/handling-native-view-animations-with-ionic-framework/。无需加载任何脚本。
#1
0
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.
原来这是插件的问题。我现在已经按照本教程进行操作了:http://www.gajotres.net/handling-native-view-animations-with-ionic-framework/。无需加载任何脚本。