jose jose - 2 months ago 23
AngularJS Question

ionic not redirecting in inappbrowser

hi all i am using ionic working with inappbrowser from controller $window but i am not able to achieve help how to solve here i attached my code

controller



var options = {
location: 'yes',
clearcache: 'yes',
toolbar: 'no'
}

//url redirect code
$scope.urlredirect = function (url) {
alert(url)
$window.open(url, '_blank', options);


html



<div class="card" ng-click=urlredirect('https://www.google.co.in/?gfe_rd=cr&ei=-K-iWb3mO-HH8gfMkpQo') >
<div class="item item-text-wrap" >

</div>
</div>

Answer Source

Try switch $window to window:

window.open(url, '_blank', 'location=yes');