Skip to content
This repository was archived by the owner on Mar 16, 2021. It is now read-only.

Commit 3c9d364

Browse files
madoarswistach
authored andcommitted
Refactor the way HotTableRegisterer is injected (#50)
* Update README.md * - refactor the way HotTableRegisterer is injected
1 parent ff49cc6 commit 3c9d364

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

lib/ce/src/hot-column.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { HotTableComponent } from './hot-table.component';
1717
})
1818

1919
export class HotColumnComponent implements OnInit, OnChanges, OnDestroy {
20-
private parentComponent: HotTableComponent;
2120
private firstRun = true;
2221

2322
@Input() allowEmpty: boolean;
@@ -126,8 +125,7 @@ export class HotColumnComponent implements OnInit, OnChanges, OnDestroy {
126125
@Input() width: number| (() => number);
127126
@Input() wordWrap: boolean;
128127

129-
constructor(private inj: Injector) {
130-
this.parentComponent = this.inj.get(HotTableComponent);
128+
constructor(private parentComponent: HotTableComponent) {
131129
}
132130

133131
ngOnInit() {

lib/pro/src/hot-column.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { HotTableComponent } from './hot-table.component';
1818
})
1919

2020
export class HotColumnComponent implements OnInit, OnChanges, OnDestroy {
21-
private parentComponent: HotTableComponent;
2221
private firstRun = true;
2322

2423
@Input() allowEmpty: boolean;
@@ -141,8 +140,7 @@ export class HotColumnComponent implements OnInit, OnChanges, OnDestroy {
141140
@Input() licenseKey: string;
142141
@Input() trimRows: boolean | number[];
143142

144-
constructor(private inj: Injector) {
145-
this.parentComponent = this.inj.get(HotTableComponent);
143+
constructor(private parentComponent: HotTableComponent) {
146144
}
147145

148146
ngOnInit() {

0 commit comments

Comments
 (0)