diff options
| -rw-r--r-- | src/Angular.js | 2 | ||||
| -rw-r--r-- | test/AngularSpec.js | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js index 2f89fbbd..512ee829 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -428,7 +428,7 @@ function HTML(html, option) { }; } -if (msie) { +if (msie < 9) { nodeName_ = function(element) { element = element.nodeName ? element : element[0]; return (element.scopeName && element.scopeName != 'HTML' ) ? uppercase(element.scopeName + ':' + element.nodeName) : element.nodeName; diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 9b3357e5..444b9448 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -562,4 +562,25 @@ describe('angular', function(){ expect(scope.greeting).toEqual('hello world'); }); }); + + + describe('nodeName_', function() { + it('should correctly detect node name with "namespace" when xmlns is defined', function() { + var div = jqLite('<div xmlns:ngtest="http://angularjs.org/">' + + '<ngtest:foo ngtest:attr="bar"></ng:test>' + + '</div>')[0]; + expect(nodeName_(div.childNodes[0])).toBe('NGTEST:FOO'); + expect(div.childNodes[0].getAttribute('ngtest:attr')).toBe('bar'); + }); + + if (!msie || msie >= 9) { + it('should correctly detect node name with "namespace" when xmlns is NOT defined', function() { + var div = jqLite('<div xmlns:ngtest="http://angularjs.org/">' + + '<ngtest:foo ngtest:attr="bar"></ng:test>' + + '</div>')[0]; + expect(nodeName_(div.childNodes[0])).toBe('NGTEST:FOO'); + expect(div.childNodes[0].getAttribute('ngtest:attr')).toBe('bar'); + }); + } + }); }); |
