Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
123 views

In GitOp I want to replace config.json for each environment and with this internal app I want to keep it as simple as possible (e.g. no ngrx) My problem is that config.json is loaded in a ...
furion2000's user avatar
1 vote
2 answers
2k views

I'm using @Inject(String) to enable giving config at the instantiation of my service. Here's the code: const httpLoaderFactory: (http: HttpClient) => TranslateHttpLoader = (http: HttpClient) => ...
Raphaël Balet's user avatar
0 votes
2 answers
268 views

I have this custom class called SortState that represents sorting and paging on a table of records. Now I want to make that class talk to a service that displays a loading indicator. Apparently you ...
Luke Bretscher's user avatar
1 vote
1 answer
53 views

Imagine the situation where you provide any lib to client. Simple scenario, spinner interceptor which needs spinner service. In old way it was possible to: providers: [ { provide: ...
turtle's user avatar
  • 41
1 vote
1 answer
109 views

I'm working on an Angular project and using the ngx-export-as package, which was already installed and working fine in some of my components. However, when I tried to use the same ExportAsService in a ...
Lojini's user avatar
  • 166
2 votes
1 answer
122 views

I recently discovered the HostAttributeToken in Angular (see docs) to provide static attributes for a component. The following example works fine: import { Component, HostAttributeToken, inject } from ...
kerosene's user avatar
  • 921
2 votes
1 answer
629 views

I have a piece of code from an angular application like below, { provide: APP_INITIALIZER, deps: [...config.mockApi.services], useFactory: () => (): any => null, multi: true, } ...
Arman's user avatar
  • 21
1 vote
1 answer
75 views

Given the following structure: a parent standalone component named AppComponent a child standalone component called TableComponent, which should be a wrapper for a generic table TableComponent ...
kerosene's user avatar
  • 921
6 votes
2 answers
2k views

Using Angular SSR, I would like to access a server-side value in my app.component. Here is my server-side route: app.get('**', (req, res, next) => { const { protocol, originalUrl, baseUrl, ...
Brandon Taylor's user avatar
1 vote
2 answers
619 views

How to inject a Service inside ApplicationConfig? export const appConfig: ApplicationConfig = { providers: [ provideRouter(appRoutes), provideTransloco({ config: { ...
Maksat Madeniyetov's user avatar
1 vote
1 answer
52 views

My Angular app works in Chrome. export interface UserService { me(): Observable<Response<User>>; } export const UserServiceRef = Symbol(); ---- providers: [ { provide: ...
Conde's user avatar
  • 951
0 votes
0 answers
76 views

I have a component, which I will build using my custom builder. This builder builds my component in ESM format. My component code (which will be built) is a simple standalone component which imports ...
ruddnisrus's user avatar
0 votes
1 answer
121 views

I have an Angular directive (LevelDirective) designed to determine its level based on its parent's level (i.e. if parent has level 1 => I should have level 2). It uses a standalone LevelService to ...
Alexandru Tatarciuc's user avatar
2 votes
1 answer
1k views

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
  • 225
0 votes
1 answer
62 views

I read several articles about the two types of injector hierarchies in Angular - the ElementInjector and the EnvironmentInjector hierarchies, and what type of dependencies they provide, and how when ...
atiyar's user avatar
  • 8,385
0 votes
1 answer
100 views

I'm following the Angular documentation for service workers (https://angular.io/guide/service-worker-communications). The page lists a series of examples of services used to handle service worker ...
maja's user avatar
  • 830
0 votes
3 answers
111 views

I want to override the function navigate(commands: any[], extras?: NavigationExtras): Promise<boolean> of Router to always set queryParamsHandling to true in the NavigationExtras. Therefore I ...
basti394's user avatar
  • 445
1 vote
1 answer
663 views

I am authoring an Angular library. It contains a service, which runs initialization logic in the constructor that is required for the library to work properly. I have set up the library module with a ...
JSON Derulo's user avatar
  • 18.8k
0 votes
0 answers
392 views

Injecting a different service in an interceptor is giving the above mentioned error even though Iam not importing httpClient into the the service. logger.interceptor.ts import { HttpInterceptorFn } ...
Vivek Dama's user avatar
1 vote
0 answers
95 views

I have a BadgeComponent with this template: <draw-circle [position.x]="position.x" [position.y]="position.y" [resolution]="20" [radius]="2" [color]=...
jlang's user avatar
  • 1,063
7 votes
4 answers
31k views

I am using Angular v16 and I have the following config that needs to be included in app.module. What is the best way to inject appConfig in app.module? It works if I include them directly inside app....
SKL's user avatar
  • 1,493
1 vote
0 answers
205 views

tl;dr: How does Angular know that an injection token passed to injector.get corresponds with an injection token of a particular provider? According to the Angular documentation, an InjectionToken can ...
F-H's user avatar
  • 1,213
0 votes
1 answer
301 views

Now I inject my extra components to my main component's root level in a directive, with this approach: @Directive({ selector: '[my-controls]', }) export class MyControlsDirective implements OnInit, ...
David Gregor's user avatar
1 vote
0 answers
133 views

I'm trying to use ngx-permissions to manage my app permissions. My app is depending on a library to share some features to different apps and the permissions will be loaded by this library. The ...
Gopalakrishnan R's user avatar
0 votes
0 answers
53 views

so i have started to learn more about Dependency Injection. And as it was written in Docs, i expect that if i have 2 separate modules and both of them have their own provider in provider array. I'll ...
Iceneo's user avatar
  • 61