angularjsangular-routingng-bind-html

How to allow external link in angularjs when using ng-bind-html


Here is the rendered code

<div>dfdbfbdfbdfbdfbdfbfb gdfgfggtbrtb  
   <a href="www.github.com" target="_blank"> rtrtrt
   </a>
   <p></p>
</div>

I get this, when i click in the hyperlinked text

https://myapp.io/www.github.com

Solution

  • Remember to use HTTP protocol with external links, if you don't use HTTP before the link, it will be considered as local resource link. In your above mentioned code you should use

    <a href="http://www.github.com">Github</a>

    Instead of

    <a href="www.github.com">Github</a>