我不能让离子深度链接工作。我得到了这个错误。(我安装了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) {发布于 2016-11-29 08:30:06
您可能需要运行以下命令:
bower install ionic-native --savehttps://stackoverflow.com/questions/39155187
复制相似问题