Angular路由在CordovaiOS上不起作用
创始人
2024-10-28 05:30:55
0

在Cordova iOS中,需要使Angular路由与InAppBrowser兼容。要实现这一点,请将以下代码添加到app.js文件中:

app.config(['$provide', function($provide) { $provide.decorator('$browser', ['$delegate', function($delegate) { if (window.cordova) { // Device return function() { return { poll: function() {}, // This is not a proper implementtaion, but it is enough for demostration // purposes. It only checks whether Cordova is already loaded by requesting // it on the window object. // Note: in iOS the local file system requests do not work, so you have to // add 'file://' to your whitelist to let them work. // If you are using InAppBrowser plugin, you should skip the whitelist and // use the cordova.InAppBrowser.open() method. navigate: function(url) { if (url !== 'about:blank') { window.location.href = url; } } }; }; } return $delegate; }]); }]);

这将装饰Angular的$browser服务并更改其导航方法,使其使用InAppBrowser插件而不是默认窗口方法。以这种方式更改后,Angular路由在Cordova iOS上应该起作用。

相关内容

热门资讯

透视软件!德州透视脚本,wep... 透视软件!德州透视脚本,wepoker破解器激活码,力荐教程(有挂内幕)亲,关键说明,wepoker...
透视能赢!wepokerplu... 透视能赢!wepokerplus透视脚本免费,wepoker私人局透视插件(透视)教你攻略(有挂辅助...
透视透视!wpk官网下载链接,... 透视透视!wpk官网下载链接,wejoker私人辅助软件,分享教程(有挂技巧);1、透视透视!wpk...
透视中牌率!wepoker挂,... 透视中牌率!wepoker挂,wepoker怎么看牌型(透视)攻略教程(有挂解密)1、透视中牌率!w...
透视科技!德州局怎么透视,aa... 透视科技!德州局怎么透视,aapoker ai插件,扑克教程(有挂详情);德州局怎么透视辅助器中分为...
透视科技!wejoker辅助软... 透视科技!wejoker辅助软件价格,wepoker怎么增加运气(透视)科技教程(有挂攻略)1、让任...
透视新版!菠萝德普辅助器免费版... 透视新版!菠萝德普辅助器免费版在哪里,wepoker插件功能辅助器,扑克教程(有挂秘笈)1、菠萝德普...
透视游戏!wepoker到底有... 透视游戏!wepoker到底有没有透视,德扑圈有透视吗,wepoke教程(有挂攻略);1、wepok...
透视辅助!wepoker黑侠辅... 透视辅助!wepoker黑侠辅助器正版下载,wepoker辅助分析器(透视)力荐教程(有挂黑科技)1...
透视好友房!hhpoker软件... 透视好友房!hhpoker软件可以玩吗,微扑克微乐辅助,新2025版(有挂详情);1、玩家可以在hh...