Skip to main content
0 votes
2 answers
37 views

Angular Singlton Generic Service with dynamic return type

i have this event management service in my angular application. i want to set the return type of the OnEvent() method dynamiclly and i want to set the type where i inject the service in my components. ...
Pouya Babaie's user avatar
0 votes
1 answer
31 views

How non-signal values notify angular for updating the component's UI

Custom services in Angular can have either signal based or non-signal based properties. In case of signal based properties, if they update, angular ensures to notify the component (which injects such ...
Aneesh Gupta's user avatar
1 vote
1 answer
142 views

How can I make an Angular service injectable only within a specific module?

I am trying to create a service in Angular that should only be injectable within a specific module, not accessible outside that module. I have a service MyService that I want to restrict so it can ...
Buffden's user avatar
  • 11
0 votes
1 answer
165 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
64 views

BehaviorSubject does not update when called from app.config.ts

TL;DR - Solution: I was using subscribe rather than pipe the value to the APP_INITIALIZER. Also, I was registering twice UserService, once as a singleton (which it should be) and second time within ...
xarielah's user avatar
  • 515
3 votes
2 answers
93 views

2 observables declared with takeUntilDestroyed, when combined, require additional takeUntilDestroyed?

I'm using takeUntilDestroyed to manage my subscriptions and avoid memory leaks. Within an injection context, variable declaration, I will have something like this mySubject1$ = new BehaviourSubject<...
Fred2020's user avatar
  • 477
1 vote
2 answers
168 views

Why NullInjectionError problem not solved by adding ProvideHttpClient() in app.config file of Angular 18

I am trying to fetch data from the backend of my application. The data fetching works well with combination of promise and fetch function. But when I tried to implement it using HttpClient service it ...
SAFIQUL ISLAM UZZAL 203-15-144's user avatar
1 vote
1 answer
453 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,165
1 vote
1 answer
32 views

Getting "Property info and results doesn't exist on type Response"

I have created a service to make an HTTP request to fetch users. But, I'm getting an error while modifying the API response. I tried everything and can't figure out the solution. Here's is the image ...
MaPuk's user avatar
  • 13
0 votes
2 answers
128 views

Using async/await with a service call

I'm having trouble understanding how to use async/await in this scenario. I have a function GetAdditionalProducts() that calls a service and returns a result. I call that function elsewhere where I ...
noclist's user avatar
  • 1,787
0 votes
1 answer
73 views

Not able to retrieve Angular signal from service

I am trying to use a service to be able to put the selected division object in a service and then retrieve it in the detail form. the code for the service is: private currentDivision = signal<...
Rich's user avatar
  • 11
0 votes
1 answer
237 views

Handling Checkbox Interactions and Pagination in Angular Table

I am working on an Angular application that includes a table with pagination implemented on the server side. One of the columns in the table contains a checkbox that acts as a "Select All" ...
Vladislav Kochurko's user avatar
0 votes
1 answer
72 views

Angular lazy loading component and service

May you explain me some fact? I have this code sharedservice.ts @Injectable({ providedIn: 'root' }) export class SharedService { id = (new Date()).getTime(); } main.ts export const ROUTES: Route[...
gen32's user avatar
  • 11
2 votes
1 answer
285 views

DOCUMENT injection token for SSR angular service causes NotYetImplemented error

I have an Angular SSR app with a service that references document. I use the DOCUMENT injection token to provide document as a DI. Here is the repo: https://github.com/JakeLo123/ng-ssr import { Inject,...
Jake Loew's user avatar
  • 197
0 votes
1 answer
211 views

Angular NullInjectorError: No provider for JwtHelperService in Standalone Component

I just started with Angular and I encounter this error when using JwtHelperService: "ERROR NullInjectorError: R3InjectorError(Standalone[_LoginComponent])[_AuthService -> _AuthService -> ...
strasouch's user avatar

15 30 50 per page
1
2 3 4 5
140