0

Here's my twitter link in angular:

a.preventDefault(href='javascript:window.open("https://twitter.com/intent/tweet?original_referer={{url}}&url={{url}}", "_blank", "width=400,height=500");void(0);') Twitter

The result is

<a href="unsafe:javascript:window.open(&quot;https://twitter.com/intent/tweet?original_referer=&amp;url=&quot;, &quot;_blank&quot;, &quot;width=400,height=500&quot;);void(0);" class="preventDefault">Twitter</a>

What's with the unsafe stuff? It doesn't work. How do I fix it thanks.

Harry
  • 52,711
  • 71
  • 177
  • 261

2 Answers2

1

I don't much about the "safelink", but I think using the wrapper object $window instead of the raw object window is better. Because may be angular does many things by default when using the wrapper object

Noor
  • 19,638
  • 38
  • 136
  • 254
0

This unsafe tag is added by windows. You need to make the html safe or else you need to whitelist these urls.

Hardik Thakkar
  • 394
  • 5
  • 17