Skip to content

Commit b2b1700

Browse files
committed
fix issues with ie 7
1 parent 3b41979 commit b2b1700

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

test/BinderTest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,10 @@ BinderTest.prototype.testBindClass = function() {
407407
BinderTest.prototype.testBindClassEvenOdd = function() {
408408
var x = this.compile('<div><div ng:repeat="i in [0,1]" ng:class-even="\'e\'" ng:class-odd="\'o\'"/></div>');
409409
x.scope.$eval();
410+
var d1 = jqLite(x.node[0].childNodes[1]);
411+
var d2 = jqLite(x.node[0].childNodes[2]);
412+
expect(d1.hasClass('o')).toBeTruthy();
413+
expect(d2.hasClass('e')).toBeTruthy();
410414
assertEquals(
411415
'<div><#comment></#comment>' +
412416
'<div class="o" ng:class-even="\'e\'" ng:class-odd="\'o\'" ng:repeat-index="0"></div>' +

test/testabilityPatch.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ function sortedHtml(element) {
6363
html += '<' + node.nodeName.toLowerCase();
6464
var attributes = node.attributes || [];
6565
var attrs = [];
66+
if (node.className)
67+
attrs.push(' class="' + node.className + '"');
6668
for(var i=0; i<attributes.length; i++) {
6769
var attr = attributes[i];
6870
if(attr.name.match(/^ng:/) ||
@@ -76,6 +78,7 @@ function sortedHtml(element) {
7678
attr.name !='complete' &&
7779
attr.name !='maxLength' &&
7880
attr.name !='size' &&
81+
attr.name !='class' &&
7982
attr.name !='start' &&
8083
attr.name !='tabIndex' &&
8184
attr.name !='style' &&

0 commit comments

Comments
 (0)