Basic rule is that if you are going to do anything with the DOM then you should have a directive and use normal JQuery in the link function
new-tab.directive.coffee
angular.module 'my.module'
.directive 'newTab', ($window) ->
restrict: 'A'
link: (scope, element, attributes) ->
element.on('click', (evt)->
# Open link in new tab here
)
Example Usage:
<a href='/your/link' new-tab>
You will likely have to do some "prevent default" stuff as well so that the link doesn't still go to the same page in the current window (now that I think about it).
You could also try just setting the _target='blank' property on any and all a nodes.
I haven't tested this
new-tab-a.directive.coffee
angular.module 'my.module'
.directive 'a', -> #I doubt this is a good idea though using 'a' as a directive name.
restrict: 'E'
link: (scope, element, attributes) ->
attributes.target = '_blank'