Lets you set anchor tags that cause a full page reload instead of letting ngRoute handle the page-change
<!-- This link will be handled by ngRoute --> | |
<a href="/angularpage">AngularJS Link</a> | |
<!-- With directive, this link will cause a full page load and may be handled by your server --> | |
<a href="/railspage" trd-external>Rails Link</a> | |
<!-- Manually, this link will cause a full page load and may be handled by your server --> | |
<a href="/railspage" target="_self">Rails Link</a> |
angular.module('tdConsoleApp') | |
.directive('trdExternal', function () { | |
'use strict'; | |
return { | |
restrict: 'A', | |
link: function (scope, iElement) { | |
iElement.attr('target', '_self'); | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment