Skip to content

Commit 1e97067

Browse files
committed
[dev] refactoring
1 parent d624979 commit 1e97067

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import "../../../node_modules/@dhx/trial-diagram/codebase/diagram.min.css";
22

33
.widget {
4-
position: relative;
54
width: 100%;
65
height: 100%;
76
}

src/app/diagram/diagram.component.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@ import { IDefaultEditorConfig } from "@dhx/trial-diagram/codebase/types/ts-diagr
2020
export class DiagramComponent implements OnInit, OnDestroy {
2121
@ViewChild("here", { static: true }) diagramContainer!: ElementRef;
2222

23-
private _diagram: any;
23+
private _diagram: DiagramEditor | null = null;
2424

2525
ngOnInit() {
2626
const data = getData();
27-
let diagram = new DiagramEditor(this.diagramContainer.nativeElement, { type: "default" } as IDefaultEditorConfig);
28-
diagram.parse(data);
29-
this._diagram = diagram;
27+
this._diagram = new DiagramEditor(this.diagramContainer.nativeElement, { type: "default" } as IDefaultEditorConfig);
28+
this._diagram.parse(data);
3029
}
3130

3231
ngOnDestroy(): void {
33-
this._diagram.destructor();
32+
this._diagram?.destructor();
3433
}
3534
}

0 commit comments

Comments
 (0)