Skip to content

Commit aded0db

Browse files
committed
chore(*): use changes of children instead of children
1 parent a948eb7 commit aded0db

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

projects/igniteui-angular/src/lib/grids/column.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,9 +1793,13 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
17931793
this.children.forEach(child => {
17941794
child.parent = this;
17951795
});
1796+
/*
1797+
TO DO: In Angular 9 this need to be removed, because the @ContentChildren will not return the `parent`
1798+
component in the query list.
1799+
*/
17961800
this.children.changes.pipe(takeUntil(this.destroy$))
1797-
.subscribe(() => {
1798-
if (this.children && this.children.toArray().length > 0 && this.children.toArray()[0] === this) {
1801+
.subscribe((change) => {
1802+
if (change.length > 1 && change.first === this) {
17991803
this.children.reset(this.children.toArray().slice(1));
18001804
this.children.forEach(child => {
18011805
child.parent = this;

0 commit comments

Comments
 (0)