I'm getting Type Error when trying to destroy the viewer in Angular2.
for that I tried this code,
ngOnDestroy() {
if (this.viewer && this.viewer.running) {
this.viewer.tearDown();
this.viewer.finish();
this.viewer = null;
}
}
But getting Error like below:
TypeError: Cannot read property 'updateMaterials' of null
at tick (viewer3D.js:27154)
at animloop (viewer3D.js:27631)
at ZoneDelegate.invokeTask (zone.js:356)
at Object.onInvokeTask (node_modules/@angular/core//bundles/core.umd.js:9091)
at ZoneDelegate.invokeTask (zone.js:355)
at Zone.runTask (zone.js:256)
at ZoneTask.invoke (zone.js:423)
How can I fix this issue using Angular2?