I'm using ng-bind-html to put up some HTML content on my site. The problem is if the content has links, the links open in the same window when clicked. How can I make it open in a new window?
<div ng-bind-html="currentElement.content"></div>
I'm using ng-bind-html to put up some HTML content on my site. The problem is if the content has links, the links open in the same window when clicked. How can I make it open in a new window?
<div ng-bind-html="currentElement.content"></div>
links contained in your currentElement.content should have the attribute target='_blank'
if the html content comes from an external source, you could add a filter that parses the html content and adds the target attribute to links
this is a sketch:
more in details
//script.js
http://plnkr.co/edit/tpl:JHcBgtJ75fVaqFYQlE4a