-1

In my page,I have a link on which i clicked it should open in a new tag but its not working for me.Can anyone please suggest help.So far I hadd tried the below

         <a target="_BLANK" ng-href="{{news.url}}">{{news.url}}</a>
striker
  • 51
  • 1
  • 1
  • 5
  • Possible duplicate of [How to open link in new tab on html?](http://stackoverflow.com/questions/17711146/how-to-open-link-in-new-tab-on-html) – Christopher Moore Feb 11 '17 at 09:57

3 Answers3

1

target="{{condition ? '_blank' : '_self'}}" should do it

In your case do:

<a target="{{condition ? '_blank' : '_self'}}" ng-href="{{news.url}}">{{news.url}}</a>
Ambrish Pathak
  • 3,813
  • 2
  • 15
  • 30
0

You can try <a target="_BLANK" href="{{news.url}}">{{news.url}}</a> instead of ng-href.

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Roshane Perera
  • 132
  • 1
  • 6
0

Use href instead of ng-href

<a target="_blank" href="google.co.in">google.co.in</a>
Sumit Sinha
  • 189
  • 1
  • 2
  • 12