简体   繁体   English

在角度离子应用程序中添加原生过渡插件时出错

[英]Getting error while adding native transitions plugin in angular ionic app

Trying to add native transitions to my app but getting error "Error: [$injector:nomod] Module 'ionic-native-transitions' 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." 尝试将原生过渡添加到我的应用程序,但收到错误“错误:[$ injector:nomod]模块'ionic-native-transitions'不可用!您拼错了模块名称或忘记加载它。如果注册模块,请确保你将依赖项指定为第二个参数。“ I have properly added the dependency.Any lead will be appreciated.Thanks in advance :) 我已经正确添加了依赖。任何领导将不胜感激。谢谢你提前:)

App.js App.js

angular.module('starter', ['ionic','ionic-native-transitions','starter.controllers'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function($window) {
 if(window.cordova && window.cordova.plugins.Keyboard) {
            cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
      cordova.plugins.Keyboard.disableScroll(true);
    }
    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
  });
})
 .config(function($stateProvider,$ionicNativeTransitionsProvider,$urlRouterProvider,$ionicConfigProvider) {
.state('chat', {
      url: '/chat',
      nativeTransitions: {
        "type": "flip",
        "direction": "up"
    }, 
      templateUrl: 'templates/chat.html',

  })

HTML HTML

 <div ui-sref="chat"  class="title" >
    <a  class="underline" ui-sref="chat"  native-transitions>
      <img class = "title-image" src="img/Chat@1x.png"></img>
          <p class="imgtext" style="color: rgb(102, 0, 0)">Chat</p>
    </a><br>
 </div>

You need to include the dist script to your page. 您需要将dist脚本包含在您的页面中。 If you use commonjs a simple require would do. 如果你使用commonjs,那么简单的要求就可以了。 If not include de script tag with the plugin path in your page 如果不包含带有插件路径的de script标签

<script src="/your/path/ionic-native-transitions.js"><script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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