ViewDestroyedError: Attempt to use a destroyed view: detectChanges

Padegal Saigiriraj is right. But instead of ViewRef_ use ViewRef. In short:

setTimeout(() => {
  if (this.cdr && !(this.cdr as ViewRef).destroyed) {
    this.cdr.detectChanges();
  }
});

ViewRef stands for Angular view, specifically the host view as Angular site describes.

Leave a Comment

tech