title: How to give session idle timeout in angular 6?
body: <p>We are maintaining a session based on user role. We want to implement timeout functionality when the session is idle for 5 min. We are using @ng-idle/core npm module to do that.</p>
  
  <p>My Service file:</p>
  
  <pre><code> import { ActivatedRouteSnapshot } from '@angular/router';
   import { RouterStateSnapshot } from '@angular/router';
   import {Idle, DEFAULT_INTERRUPTSOURCES, EventTargetInterruptSource} from 
   '@ng-idle/core';
   @Injectable()
  export class LoginActService implements CanActivate {
  constructor(private authService: APILogService, private router: 
   Router,private idle: Idle) {
    idle.setIdle(10);
    idle.setTimeout(10);
   }
  canActivate(
  next: ActivatedRouteSnapshot,
  state: RouterStateSnapshot
   ): Observable&lt;boolean&gt;|Promise&lt;boolean&gt;|boolean {
  let role = localStorage.getItem('currentUser');
  
  if (localStorage.getItem('currentUser')) {
    if(next.data[0] == role){
     },600000) 
      return true;
    } 
  }
  else{
    this.router.navigate(['/'], { queryParams: { returnUrl: state.url }});
    return false;
    }
   }
  }
  </code></pre>
  
  <p>For sample, I have used setIdle timeout for 5 seconds, But it is not happening. Can somebody guide me how to do this?</p>