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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)