feat(change detection): add removeShadowDomChild

This commit is contained in:
Tobias Bosch 2015-04-14 18:01:08 -07:00
parent cb2e646332
commit 6ecaa9aebb
2 changed files with 11 additions and 0 deletions

View File

@ -33,6 +33,10 @@ export class AbstractChangeDetector extends ChangeDetector {
cd.parent = this; cd.parent = this;
} }
removeShadowDomChild(cd:ChangeDetector) {
ListWrapper.remove(this.shadowDomChildren, cd);
}
remove() { remove() {
this.parent.removeChild(this); this.parent.removeChild(this);
} }

View File

@ -484,6 +484,13 @@ export function main() {
expect(parent.lightDomChildren).toEqual([]); expect(parent.lightDomChildren).toEqual([]);
}); });
it("should remove shadow dom children", () => {
parent.addShadowDomChild(child);
parent.removeShadowDomChild(child);
expect(parent.shadowDomChildren.length).toEqual(0);
});
}); });
}); });