File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -407,6 +407,10 @@ BinderTest.prototype.testBindClass = function() {
407407BinderTest . 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>' +
Original file line number Diff line number Diff 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 ( / ^ n g : / ) ||
@@ -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' &&
You can’t perform that action at this time.
0 commit comments