Click here to Skip to main content
15,892,805 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i try to detect if user is ideal for some time then redirect him to login page

JavaScript
hi i have problem integrating (ng2-idle)[https://github.com/HackedByChinese/ng2-idle] with my angular 2 final release 2.0.1 application it's
```
No provider for Http!
```
the package.json enties for ng2-idle package
```
"ng2-idle": "1.0.0-alpha.16",
 "ng2-idle-keepalive": "1.0.0-alpha.9"
```
i have shared.module.ts which it shared across multiple components
the two providers for the ng2-idle are
```
 IDLE_PROVIDERS,
  KEEPALIVE_PROVIDERS
```
here is my shared.module.ts file
https://gist.github.com/TheSniper102/7991ed473c5f99ec1191d3ba14e79d02


What I have tried:

shared.module.ts · GitHub[^]
Posted
Updated 25-Oct-16 7:07am

1 solution

Did you try adding Idle and Keepalive in the providers section?

import { Idle, IDLE_PROVIDERS} from "ng2-idle/core";
import { Keepalive, KEEPALIVE_PROVIDERS } from "ng2-idle-keepalive/core";

@NgModule({
    imports: [
        HttpModule

    ],
    providers: [
        Idle,
        Keepalive,
        KEEPALIVE_PROVIDERS,
        IDLE_PROVIDERS
    ],
})
export class SharedModule { } 
 
Share this answer
 
Comments
TheSniper105 26-Oct-16 5:04am    
yes but same error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900