Skip to main content

All Questions

0 votes
1 answer
86 views

Angular 17: Standalone components and not a root service

How can I provide a service that is not at the root of the application, and use the same instance between several components and other services? Not using providers in routes and not using ng module. ...
Anatoly Surgutov's user avatar
1 vote
1 answer
126 views

Angular Standalone - How to Inject Service into Service

I'm a longtime Angular dev now trying to learn the standalone version. How do I inject a service into another service without a providers array in the NgModule. Is my only choice using providedIn in ...
emery.noel's user avatar
  • 1,155
2 votes
1 answer
982 views

How to include Angular services with lazy-loaded standalone component routes?

I have an Angular 17 application using standalone components, the initial routes are set up like so in app.routes.ts export const appRoutes: Array<Route> = [ { path: '', redirectTo: '/...
Chris Barr's user avatar
  • 33.4k
21 votes
6 answers
19k views

NullInjectorError - Root standalone component does not import HttpClientModule properly

I have an issue, I want to rewrite my app code and change main module to main root standalone component pointed in main.ts. All works fine but I have an issue with HttpClientModule. I am using ...
Patryk's user avatar
  • 1,087
-1 votes
1 answer
975 views

Angular service to transfer data between components (standalone components - NG14) [closed]

I know we can use a service, @Input and @Output so move data between components. For example I can have this in a service: @Injectable() export class MyService { myMethod$: Observable<any>; ...
keszok's user avatar
  • 67