diff options
Diffstat (limited to 'src/ng/directive/a.js')
| -rw-r--r-- | src/ng/directive/a.js | 18 | 
1 files changed, 14 insertions, 4 deletions
diff --git a/src/ng/directive/a.js b/src/ng/directive/a.js index 9b6c67c9..7ee8f572 100644 --- a/src/ng/directive/a.js +++ b/src/ng/directive/a.js @@ -16,10 +16,20 @@  var htmlAnchorDirective = valueFn({    restrict: 'E',    compile: function(element, attr) { -    // turn <a href ng-click="..">link</a> into a link in IE -    // but only if it doesn't have name attribute, in which case it's an anchor -    if (!attr.href) { -      attr.$set('href', ''); + +    if (msie <= 8) { + +      // turn <a href ng-click="..">link</a> into a stylable link in IE +      // but only if it doesn't have name attribute, in which case it's an anchor +      if (!attr.href && !attr.name) { +        attr.$set('href', ''); +      } + +      // add a comment node to anchors to workaround IE bug that causes element content to be reset +      // to new attribute content if attribute is updated with value containing @ and element also +      // contains value with @ +      // see issue #1949 +      element.append(document.createComment('IE fix'));      }      return function(scope, element) {  | 
