Closed vamcs closed 4 years ago
Describe the bug No observable is ever triggered, and the extension simply can't be used.
To Reproduce Create an Angular 8 project and implement the example project.
In app.module.ts I provided the service with NgIdleModule.forRoot() in the imports array. And this is the constructor of app.component.ts:
app.module.ts
NgIdleModule.forRoot()
app.component.ts
constructor(private idle: Idle) { this.idle.setIdle(5); this.idle.setTimeout(5); this.idle.setInterrupts(DEFAULT_INTERRUPTSOURCES); this.idle.onIdleStart.subscribe(() => console.log('Gone idle')); this.idle.onIdleEnd.subscribe(() => console.log('Idle no more')); this.idle.onTimeoutWarning.subscribe((countdown: number) => console.log( `You'll be logged out in ${countdown} seconds because of inactivity.` ) ); this.idle.onTimeout.subscribe(() => console.log('Timeout')); }
Expected behavior The extension would work at all.
Please tell us about your environment
Of course, the problem was simple. I forgot to call idle.watch() to tell the extension to start running.
idle.watch()
Describe the bug No observable is ever triggered, and the extension simply can't be used.
To Reproduce Create an Angular 8 project and implement the example project.
In
app.module.ts
I provided the service withNgIdleModule.forRoot()
in the imports array. And this is the constructor ofapp.component.ts
:Expected behavior The extension would work at all.
Please tell us about your environment