aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/a.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng/directive/a.js')
-rw-r--r--src/ng/directive/a.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ng/directive/a.js b/src/ng/directive/a.js
index fe50a79b..9887cba5 100644
--- a/src/ng/directive/a.js
+++ b/src/ng/directive/a.js
@@ -32,11 +32,14 @@ var htmlAnchorDirective = valueFn({
element.append(document.createComment('IE fix'));
}
- if (!attr.href && !attr.name) {
+ if (!attr.href && !attr.xlinkHref && !attr.name) {
return function(scope, element) {
+ // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
+ var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?
+ 'xlink:href' : 'href';
element.on('click', function(event){
// if we have no href url, then don't navigate anywhere.
- if (!element.attr('href')) {
+ if (!element.attr(href)) {
event.preventDefault();
}
});