无法使Ionic Deeplink工作

时间:2016-08-25 21:44:18

标签: ionic-framework cordova-plugins deep-linking

我不能让Ionic Deeplink工作。我收到这个错误。 (我安装了https://github.com/driftyco/ionic-native)。

错误:[$ injector:modulerr]由于以下原因无法实例化ionic.native模块: 错误:[$ injector:nomod]模块'ionic.native'不可用!您要么错误拼写了模块名称,要么忘记加载它。如果注册模块,请确保将依赖项指定为第二个参数。

    angular.module('starter', ['ionic', 'ionic.native', 'starter.controllers', 'starter.services', 'ngCordova', 'imageCropper','ngStorage'])

  .run(['$ionicPlatform', '$cordovaDeeplinks', '$state', '$timeout', function($ionicPlatform, $cordovaDeeplinks, $state, $timeout) {

    $ionicPlatform.ready(function () {

      if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
        cordova.plugins.Keyboard.disableScroll(true);

      }
      if (window.StatusBar) {
        StatusBar.styleLightContent();
      }

      $cordovaDeeplinks.route({
        '/profile': {
          target: 'tab.profile',
          parent: 'tab-profile'
        }


      }).subscribe(function(match) {

        $timeout(function() {
          $state.go(match.$route.parent, match.$args);

          $timeout(function() {
            $state.go(match.$route.target, match.$args);
          }, 800);
        }, 100); // Timeouts can be tweaked to customize the feel of the deeplink
      }, function(nomatch) {
        console.warn('No match', nomatch);
      });
    });

  }])

  .config(function ($stateProvider, $urlRouterProvider) {

1 个答案:

答案 0 :(得分:0)

您可能需要运行:

bower install ionic-native --save