File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
modules/angular2/src/platform/dom Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -365,11 +365,18 @@ function resolveInternalDomFragment(fragmentRef: RenderFragmentRef): Node[] {
365365}
366366
367367function moveNodesAfterSibling ( sibling , nodes ) {
368- if ( nodes . length > 0 && isPresent ( DOM . parentElement ( sibling ) ) ) {
369- for ( var i = 0 ; i < nodes . length ; i ++ ) {
370- DOM . insertBefore ( sibling , nodes [ i ] ) ;
368+ var parent = DOM . parentElement ( sibling ) ;
369+ if ( nodes . length > 0 && isPresent ( parent ) ) {
370+ var nextSibling = DOM . nextSibling ( sibling ) ;
371+ if ( isPresent ( nextSibling ) ) {
372+ for ( var i = 0 ; i < nodes . length ; i ++ ) {
373+ DOM . insertBefore ( nextSibling , nodes [ i ] ) ;
374+ }
375+ } else {
376+ for ( var i = 0 ; i < nodes . length ; i ++ ) {
377+ DOM . appendChild ( parent , nodes [ i ] ) ;
378+ }
371379 }
372- DOM . insertBefore ( nodes [ 0 ] , sibling ) ;
373380 }
374381}
375382
You can’t perform that action at this time.
0 commit comments