Skip to content

Commit 36462ba

Browse files
committed
fix(ColChooser): #2530 Unsubscribe from valueChange.
1 parent 9ac005f commit 36462ba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

projects/igniteui-angular/src/lib/grid-common/column-hiding/column-chooser-item-base.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventEmitter, Input, Output } from '@angular/core';
1+
import { EventEmitter, Input, Output, OnDestroy } from '@angular/core';
22

33
export interface IValueChangedEventArgs {
44
oldValue: any;
@@ -47,7 +47,7 @@ export abstract class ItemPropertyValueChanged {
4747
}
4848
}
4949

50-
export class ColumnChooserItemBase extends ItemPropertyValueChanged {
50+
export class ColumnChooserItemBase extends ItemPropertyValueChanged implements OnDestroy {
5151
@Input()
5252
get column() {
5353
return this.object;
@@ -69,6 +69,10 @@ export class ColumnChooserItemBase extends ItemPropertyValueChanged {
6969
super(prop);
7070
}
7171

72+
ngOnDestroy(): void {
73+
this.valueChanged.unsubscribe();
74+
}
75+
7276
get name() {
7377
return (this.column) ? ((this.column.header) ? this.column.header : this.column.field) : '';
7478
}

0 commit comments

Comments
 (0)