I have some trusted HTML code coming off of my database. Due to the vagaries of how it's created (text editor), none of the A elements have a target="_blank" on them.
It occurred to me this morning that instead of editing the way the HTML is emitted from the editor, I could maybe alter how ng-bind-html and $compile work to programmatically make sure that all the A elements inside this particular custom directive have a target="_blank" on them. I don't want to do that page-wide, since regular navigation in the app wants to work as normal, but I want all user-generated links to open in a new tab. Anybody have any thoughts on how to approach this? I could brute-force it with some transcludes and manually crawling the DOM, but it would be more elegant if there was some interceptor I could register with the $compile or $sanitize service. It doesn't look like this is the case, though. e -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
