2

I working with ionic pop-up where inside the popup content, I want a clickable link. The problem is that the link that I created is not working. Can't click them. My code is as follows:

var mypopup = $ionicPopup.show({
   template: '<a href="http://google.com">Google</a>',
   buttons: [{
       text: 'Ok'
   }]
})

Is there any way I can enable a user to click that link and go to Google?

Many thanks!

Akira Kronic
  • 164
  • 1
  • 12

1 Answers1

1

Add target="_blank" property inside anchor tag and it will work perfectly fine. It will launch browser.

Your current code:

template: '<a href="http://google.com">Google</a>',

Change to:

template: '<a href="http://google.com" target="_blank">Google</a>',

Here is working codepen snippet:

https://codepen.io/anon/pen/rvaONv?editors=1010

Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104