Skip to content

Commit 2f3be1e

Browse files
Refactoring
1 parent ccc4e69 commit 2f3be1e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/core/component.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export abstract class DxComponent implements AfterViewInit, INestedOptionContain
7575
}
7676
protected abstract _createInstance(element, options)
7777
protected _createWidget(element: any) {
78-
let that = this;
7978
let events = [];
8079

8180
this._initTemplates();
@@ -91,17 +90,17 @@ export abstract class DxComponent implements AfterViewInit, INestedOptionContain
9190
this.instance = this._createInstance(element, this._initialOptions);
9291

9392
this.instance.off('optionChanged', optionChangeHandler);
94-
this.instance.on('optionChanged', function(e){
95-
that.changedOptions[e.name] = e.value;
96-
that.eventHelper.fireNgEvent(e.name + 'Change', [e.value]);
93+
this.instance.on('optionChanged', (e) => {
94+
this.changedOptions[e.name] = e.value;
95+
this.eventHelper.fireNgEvent(e.name + 'Change', [e.value]);
9796
});
9897

9998
let subsriber = this.ngZone.onStable.subscribe(() => {
10099
subsriber.unsubscribe();
101100

102-
that.ngZone.run(() => {
101+
this.ngZone.run(() => {
103102
events.forEach(name => {
104-
that.eventHelper.fireNgEvent(name + 'Change', [that[name]]);
103+
this.eventHelper.fireNgEvent(name + 'Change', [this[name]]);
105104
});
106105
});
107106
});

0 commit comments

Comments
 (0)