Can't Inject service in angular 2 with ASP Core 1.1 #642

Closed
opened 2025-08-09 17:17:05 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @ahmagdy on 6/22/2017

Hi
i'm using generator-aspnetcore-spa and i'm trying to inject service into my app in Angular 2
so i added providers: [ CommService] in sharedConfig "app.module.shared.ts"
when i'm trying to run the app i got

Exception: Call to Node module failed with error: Error: Uncaught (in promise): Error: No provider for CommService!
Error: No provider for CommService!

i tried to add the service in providers in boot-server.ts
and that's what i got

Exception: Call to Node module failed with error: Error: Uncaught (in promise): Error: No provider for Http! (CommService -> Http)
Error: No provider for Http! (CommService -> Http)
at Error (native)

So where i can import and inject my Services

*Originally created by @ahmagdy on 6/22/2017* Hi i'm using generator-aspnetcore-spa and i'm trying to inject service into my app in Angular 2 so i added `providers: [ CommService]` in sharedConfig "app.module.shared.ts" when i'm trying to run the app i got > Exception: Call to Node module failed with error: Error: Uncaught (in promise): Error: No provider for CommService! > Error: No provider for CommService! i tried to add the service in providers in boot-server.ts and that's what i got > Exception: Call to Node module failed with error: Error: Uncaught (in promise): Error: No provider for Http! (CommService -> Http) > Error: No provider for Http! (CommService -> Http) > at Error (native) So where i can import and inject my Services
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#642
No description provided.