Skip to content

Commit 6ecaa9a

Browse files
committed
feat(change detection): add removeShadowDomChild
1 parent cb2e646 commit 6ecaa9a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

modules/angular2/src/change_detection/abstract_change_detector.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export class AbstractChangeDetector extends ChangeDetector {
3333
cd.parent = this;
3434
}
3535

36+
removeShadowDomChild(cd:ChangeDetector) {
37+
ListWrapper.remove(this.shadowDomChildren, cd);
38+
}
39+
3640
remove() {
3741
this.parent.removeChild(this);
3842
}

modules/angular2/test/change_detection/change_detection_spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,13 @@ export function main() {
484484

485485
expect(parent.lightDomChildren).toEqual([]);
486486
});
487+
488+
it("should remove shadow dom children", () => {
489+
parent.addShadowDomChild(child);
490+
parent.removeShadowDomChild(child);
491+
492+
expect(parent.shadowDomChildren.length).toEqual(0);
493+
});
487494
});
488495
});
489496

0 commit comments

Comments
 (0)