title: Angulr2+ : ViewDestroyedError: Attempt to use a destroyed view: detectChanges when route
body: <p>getting this error ,</p>
  
  <blockquote>
    <p>"ViewDestroyedError: Attempt to use a destroyed view: detectChanges"</p>
  </blockquote>
  
  <p>when i am trying to route from my list component to employee detail component, I called function and pass id , it is routed perfectly but in console giving me this error </p>
  
  <p>Both the Component are in same module, employee module, </p>
  
  <blockquote>
    <p>EmployeeModule(EmployeeListComponent  => EmployeeProfileComponent)</p>
  </blockquote>
  
  <p>code</p>
  
  <pre><code>editEmployee(emp){
     console.log('employee:=&gt;',emp);
    this.route.navigate(['employee/profile'],{queryParams:{empid:emp.id}})
  }
  </code></pre>