Open external url


#1

Hi
I want to make a list whre there will be 5 links
I tried href did not work
then tried as below

<div class="list">
	<a class="item item-icon-left" ng-click="open('http://need4engineer.com')">
	<i class="icon ion-android-globe"></i>
	Web Site
	</a>
  <a class="item item-icon-left" ng-click="open('http://facebook.com/need4engineer')"">
    <i class="icon ion-social-facebook"></i>
    Facebook
  </a>
   <a class="item item-icon-left" ng-click="open('http://youtube.com/need4engineer')">
    <i class="icon ion-social-youtube"></i>
    Youtube
  </a>
   <a class="item item-icon-left" ng-click="open('https://play.google.com/store/search?q=need4engineer')">
    <i class="icon ion-android-playstore"></i>
    Play Store
  </a>
    <a class="item item-icon-left" ng-click="open('need4engineer@gmail.com')">
    <i class="icon ion-email"></i>
    Play Store
  </a>
  </div>

and controller

.controller(‘AboutCtrl’, function($scope) {
$scope.open=function(link){
location.replace(link);
}
})

I tried location.href=link;

Failed in android. But when run browser of pc, works fine. Plz help


#2

Hi,
In your function open, use window.open instead of location.replace.
You can take a look to that plugin, in order to do it :cordova-plugin-inappbrowser

Few more seconds on google and I’m sure you would have found the same.


#3

thnx, Now its working :