I guess you want to test the IAB: => Ridicoulos stupid doc of ngcordova
You used the wrong name => $cordovaInAppBrowser not $cordovaPlugin!!
here is a workflow for your tests:
-
install ngCordova:
bower install ngCordova
or copy it by your selfe -
install the plugin:
cordova plugin add org.apache.cordova.inappbrowser -
check your plugins:
cordova plugin list -
check if you refered the file right in your index.html
-
require ngCordova in your module.
Here is an example:angular.module(‘modulname’, [ ‘ngCordova’])
.controller(‘controllername’, function($scope, $ionicPlatform, $cordovaInAppBrowser) {var pathToSite = 'http://www.domainname.com'; $rootScope.iabIsOpen = true; var iabDefaultSettings : { location : 'no', clearcache : 'no', toolbar : 'no' }$scope.openIAB = function(bcmsBeaconKey) {
$ionicPlatform.ready(function() { //if is open if($rootScope.iabIsOpen) { console.log('APPTEST: iabIsOpen'); return; } $cordovaInAppBrowser .open(pathToSite, '_blank', iabDefaultSettings) .then( // success function(event) { console.log('on $cordovaInAppBrowser:open success'); }, // error function(event) { //start all loops console.log('on $cordovaInAppBrowser:open error'); $rootScope.iabIsOpen = false; }); });});
6.check you networkconnection, IAB needs internet 