user1325584
user1325584

Reputation:

Ionic : cordova is not defined

I need to use InAppBrowser, I install this plugin, and use it in controller like :-

myApp.controller('en', function($scope , $ionicLoading , $http  , $stateParams  ,$cordovaInAppBrowser) {

    $scope.PDFNotNull = true;
    $scope.iframeLoadedCallBack = function(){
            $ionicLoading.hide();
    }

    $scope.read = function() {
           cordova.InAppBrowser.open('http://www.tafseer.info/phocadownload/copy_of_the_book/khatima.pdf', '_blank', 'location=no');
    };  

});

But its show me in console this error:-

ReferenceError: cordova is not defined at l.$scope.read (en.js:22)

Where is problem

Upvotes: 0

Views: 4522

Answers (1)

Kirill Husiatyn
Kirill Husiatyn

Reputation: 828

Did you install ngCordova for this? Use $cordovaInAppBrowser.open() after you will install ngCordova. It should work fine. In other way try to reinstall plugin.

Upvotes: 2

Related Questions