From 1af62da660020dc20361cc3a26fd6c7fa5ac5c69 Mon Sep 17 00:00:00 2001 From: Alexandre Potvin Latreille Date: Wed, 18 Dec 2013 21:36:49 -0500 Subject: [PATCH 1/2] Fixed an issue that was preventing the ng-href-attr directive to work properly in IE. --- src/ng/compile.js | 4 +--- test/ng/compileSpec.js | 8 +++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index 3e5a2479cb6e..9285b253d0b3 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1009,9 +1009,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) { nName = directiveNormalize(name.toLowerCase()); attrsMap[nName] = name; - attrs[nName] = value = trim((msie && name == 'href') - ? decodeURIComponent(node.getAttribute(name, 2)) - : attr.value); + attrs[nName] = value = trim(attr.value); if (getBooleanAttrName(node, nName)) { attrs[nName] = true; // presence means true } diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 1b98cd587d8c..f86b293eb1eb 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -4243,7 +4243,13 @@ describe('$compile', function() { expect(element.attr('test2')).toBe('Misko'); expect(element.attr('test3')).toBe('Misko'); })); - + + it('should work with the "href" attribute', inject(function($compile, $rootScope) { + $rootScope.value = 'test'; + element = $compile('')($rootScope); + $rootScope.$digest(); + expect(element.attr('href')).toBe('test/test'); + })); it('should work if they are prefixed with x- or data-', inject(function($compile, $rootScope) { $rootScope.name = "Misko"; From d65f97ef98e0cddfde51f699afdfb86214902023 Mon Sep 17 00:00:00 2001 From: Alexandre Potvin Latreille Date: Wed, 18 Dec 2013 22:12:11 -0500 Subject: [PATCH 2/2] Changed the 'span' tag for a 'a' tag in the tests. --- test/ng/compileSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index f86b293eb1eb..39e236959635 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -4246,7 +4246,7 @@ describe('$compile', function() { it('should work with the "href" attribute', inject(function($compile, $rootScope) { $rootScope.value = 'test'; - element = $compile('')($rootScope); + element = $compile('')($rootScope); $rootScope.$digest(); expect(element.attr('href')).toBe('test/test'); }));