Skip to content

Commit 7587920

Browse files
committed
chore(*): use changes of children instead of children
1 parent 38ca6d8 commit 7587920

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
@@ -1850,9 +1850,13 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
18501850
this.children.forEach(child => {
18511851
child.parent = this;
18521852
});
1853+
/*
1854+
TO DO: In Angular 9 this need to be removed, because the @ContentChildren will not return the `parent`
1855+
component in the query list.
1856+
*/
18531857
this.children.changes.pipe(takeUntil(this.destroy$))
1854-
.subscribe(() => {
1855-
if (this.children && this.children.toArray().length > 0 && this.children.toArray()[0] === this) {
1858+
.subscribe((change) => {
1859+
if (change.length > 1 && change.first === this) {
18561860
this.children.reset(this.children.toArray().slice(1));
18571861
this.children.forEach(child => {
18581862
child.parent = this;

0 commit comments

Comments
 (0)