-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get library to work with Angular 2 Webpack Starter #3
Comments
I'm not much of a webpack user at this point. I grabbed the latest Angular2 Webpack Starter and I'm also having difficulties with it. I've tried it in some other bare angular2 or starter projects and it was fine. Do you have a sample project somewhere? I ran
Then I went to
Finally, in I can't even get passed the original bootstrapping. I get this error when trying to import my providers:
Of course, trying to step through these pieces is proving to be impossible. So whatever, I just copy the definition of IDLE_PROVIDERS and KEEPALIVE_PROVIDERS right into the bootstrapper and that error goes away, but then I get errors about no provider for I need a Webpack adult. |
In my project, based on Angular2 Webpack Starter, I'm able to use ng2-idle (and other 3rd party typescript libraries, like ng2-cookies) without the |
I don't know how @spicywhitefish got it to work, but I couldn't get webpack to play nice. I never got The "Invalid Provider" issue with angular RC6 and "webpack": "^1.13.0", but i am getting the "no provider for Http" bit. I think it is that webpack is keeping ng2-idle-keepalive from finding it, not that it isn't being provided. When I don't include ng2-idle-keepalive, it complains that KeepaliveSvc isn't provided. When I surgically remove that The extra weird bit is that if i simply copy the source into my project, and include it from those folders it works fine. like so: session.service.ts: app.module.ts: import { SessionComponent } from './session/session.component' Note: I did have to update keepalive.ts line 23 to |
@stephengeorgewest I have a hunch that the issue you are seeing is related to different versions of Angular. The last released version of ng2-idle (1.0.0-alpha.15) uses angular-2.0.0-rc.5, where as you're trying to use Angular 2 rc6. You can try using my distribution branches of ng2-idle and ng2-idle-keepalive that use rc6. You'll need something like the following in your package.json file:
Those specific versions are for rc6. Edit: looks like ng-idle 1.0.0-alpha.16 was just released, supporting angular-2.0.0. Try updating your angular version & ng-idle/ng-idle-keepalive, and try again. |
Yeah, that seems to work, but (un?)fortunately we updated to 2.0.0 over the weekend.
I don't see how that should even be an error. RC6 Request and 2.0.0 Request are exactly the same. |
ng2-idle@1.0.0-alpha.16 and ng2-idle-keepalive@1.0.0-alpha.9 have been upgraded to angular@2.0.0 |
Woot. That seems to work. I assume this issue can be closed. Probably #10 as well. |
I'm unable to pull ng2-idle into my angular webpack application. I get the following error: Error: No provider for KeepaliveSvc! Based on a previous issue - grbsk#3 - I suspect that this is because I'm using angular 2.0.2 but ng2-idle was built against a specific angular patch release (2.0.0). This change makes ng2-idle a little more friendly by allowing 2.0.x.
I have a project where I am using the Angular2 Webpack Starter project.
Because you've referfenced specific versions of rxjs etc., I get a node_modules directory in the node_modules/ng2-idle directory....
I get all sort of reference problems due to rxjs already being including in my typings
Have you been able to include ng2-idle in a webpack project?
If I delete the child node_modules directory, it seems to compile OK.
--mike
The text was updated successfully, but these errors were encountered: