我得到了这个代码:
.controller('CartCtrl', function ($scope, $rootScope, $state, $stateParams, $cordovaInAppBrowser, $timeout, $http) {
// Container for deviceready actions
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
$scope.abrirTeste = function () {
var ref = new $cordovaInAppBrowser('https://example.com', '_blank', 'location=yes, closebuttoncaption=DONE, footer=no');
}
}
});
我尝试在我的控制器上调用 $rootScope.$on 但它不起作用。
$rootScope.$on('$cordovaInAppBrowser:loadstop', function (e, event) {
console.log('Response: '+JSON.stringify(event));
});
如何在 loadstop 事件后从 $cordovaInAppBrowser 获得响应?