2

I have the following line of code that I have used a million times:

<a href="mailto:{{email}}" ng-hide="cancel">Contact</a>

Angular adds an unsafe: in front of the link.

I obviously know that Angular is supposed to do that but the documentation says that it should let through html and mailto.

I tried nonetheless to add a $compileProvider to no avail:

.config( [
'$compileProvider',
function( $compileProvider )
  {   
    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension):/);
  }
])
Mika
  • 5,807
  • 6
  • 38
  • 83
  • Interesting. I had the same issue and that answer worked for me. http://stackoverflow.com/questions/37491931/use-compileprovider-to-avoid-unsafe-links – Christopher Marshall Oct 06 '16 at 14:57

0 Answers0