angular.js link behaviour – disable deep linking for specific URLs

Adding target="_self" works in Angular 1.0.1:

<a target="_self" href="https://stackoverflow.com/auth/facebook">Sign in with Facebook</a>

This feature is documented (https://docs.angularjs.org/guide/$location – search for ‘_self’)

If you’re curious, look at the angular source (line 5365 @ v1.0.1). The click hijacking only happens if !elm.attr('target') is true.

Leave a Comment