This PR fixes an error that happens in our production app:
Error: ViewDestroyedError: Attempt to use a destroyed view: detectChanges
at viewDestroyedError (/./node_modules/@angular/core/fesm2015/core.js:25516:1)
at debugUpdateDirectives (/./node_modules/@angular/core/fesm2015/core.js:39361:1)
at checkAndUpdateView (/./node_modules/@angular/core/fesm2015/core.js:38376:1)
at callWithDebugContext (/./node_modules/@angular/core/fesm2015/core.js:39716:1)
at detectChanges (/./node_modules/@angular/core/fesm2015/core.js:27092:1)
...
(9 additional frame(s) were not displayed)
This happens when the changeDetectorRef tries to detectChanges on a destroyed view. I added an OnDestroy interface, which implements the detaching of the changeDetectorRef.
This PR fixes an error that happens in our production app:
This happens when the
changeDetectorRef
tries to detectChanges on a destroyed view. I added an OnDestroy interface, which implements the detaching of thechangeDetectorRef
.