Stenio Moraes
Stenio Moraes

Reputation: 53

InnapBrowser in Ionic not working

I using the InappBrowser plugin to open the site pages in my application. The problem is that when you touch the item, the InappBrowser is no return, or the ADB error logs, while in the web browser, testing with ionic serve, usually works ... Here the code:

HTML:

<ion-item ng-repeat="item in posts | filter: query" class="item-thumbnail-left item-text-wrap item-icon-right item-noticia" ng-click="urlchange('{{item.permalink}}')">
        <img class="thumb-noticia" data-ng-src="{{item.thumbnail}}">
        <h2> {{item.title}} </h2>
        <p>{{item.excerpt | limitTo: 100}}...</p>

        <ion-option-button class="button-dark button-facebook" ng-click="shareAnywhere()">
                <i class="icon ion-social-facebook icon-facebook"></i>
        </ion-option-button>
        <ion-option-button class="button-dark button-whatsapp" ng-click="shareAnywhere()">
                <i class="icon ion-social-whatsapp-outline"></i>
        </ion-option-button>
</ion-item>

AngularJS:

$scope.urlchange = function(url){
  window.open(url, '_blank', 'hidden=no');
}

Upvotes: 0

Views: 279

Answers (1)

Stenio Moraes
Stenio Moraes

Reputation: 53

Anyway, again, I decided the problem by myself...

The result:

In command line:

ionic plugin add cordova-plugin-inappbrowser

AngularJS:

$scope.urlchange = function($url, $rootScope){
    cordova.InAppBrowser.open($url, "_blank", "location=no", "clearcache: no", "toolbar: no");
}

HTML:

<ion-item ng-repeat="item in posts | filter: query" class="item-thumbnail-left item-text-wrap item-icon-right item-noticia" ng-click="urlchange('{{item.permalink}}')">

Upvotes: 1

Related Questions