306,755 questions
3
votes
2
answers
91
views
setTimeout not triggering change detection in my Angular code
I am trying to create a toast service for my e-commerce project. Initially, this was my code below. There is a toasts array and an add function. We can pass in a message to the add function and it ...
0
votes
1
answer
70
views
Angular Electron: Typescript component is not rendered in index.html
I am new in Angular environment and I am actually developing a little desktop app with electron.
I have inserted the selector (app-root) of the App component (generated automatically) into index.html'...
0
votes
0
answers
77
views
How to wrap ngMenu into a reusable component while letting consumers provide a custom trigger button?
There's an example on using the new Angular Aria menu feature here.
Below is a simplified version of the example code (with only one button):
<button ngMenuTrigger #origin #trigger="...
0
votes
0
answers
38
views
Angular SSR + Firebase App Hosting: build fails when importing shared utility functions [closed]
I am developing an Angular SSR application Angular 21 and I chose Firebase App Hosting for deployment.
The application works perfectly in local development, but the Firebase build fails when importing ...
1
vote
1
answer
77
views
Angular not loading the updated data after an API call
I am working on a simple Angular app where I fetch data from an API, then load it in the html template.
import { Component, inject, OnInit } from '@angular/core';
import { ReclamationService } from '.....
-1
votes
1
answer
72
views
Angular version 18.2.14 has a bug on @Directive standalone compiling
Looks like Angular version 18.2.14 has a bug on @Directive standalone compiling
the directive:
import { Directive, ElementRef, HostListener } from '@angular/core';
@Directive({
selector: '[...
0
votes
0
answers
43
views
Can I use node version X for building Angular Frontend and node version Y for building backend and serving the web app?
We have a Angular Web app which has a node js backend. We are using currently node version Y.
For CICD we are using a Jenkins server. Jenkins server and web server are both using node version Y. ...
0
votes
1
answer
65
views
Padding button looks even on browser inspector, but not on phone
Every time I write a primeng button for some reason in the browser inspector (even when it´s on phone view) the padding (or text) of the button looks centered:
However in my phone Google Chrome does ...
0
votes
1
answer
48
views
How to debug and identify if the component or a specific part of the component was rerendered?
In Angular, assuming I have this component where automationId is updated every new content while txt is updated less frequent. During those times that txt is NOT updated or the value remains as the ...
0
votes
0
answers
38
views
Primeng input control expands pass its container
It seems that Primeng input control has a fixed size (width) under the hood. I tried to limit the width in order to fit in a grid layout but failed: the control is wider than its container. For a ...
1
vote
2
answers
62
views
How to fit Accordion Panels to the screen?
I am using the PrimeNG Accordion component where the first panel contains a form and the second and third panel contain tables. See an example here:
https://stackblitz.com/edit/wawhkkem-rwy91iox
<...
0
votes
0
answers
69
views
Angular CdkTree expand all parent nodes
i have a use case where I have a MatTree<Item> where Item contains a key
property. Given a specific key , i would like to expand the MatTreeNode and its parent recursively till root. Currently, ...
1
vote
0
answers
47
views
ng-bootstrap Datepicker throws NG0203 takeUntilDestroyed() error on Angular 20
Problem
When clicking on an ngbDatepicker input to open the datepicker popup, I get the following runtime error:
ERROR RuntimeError: NG0203: takeUntilDestroyed() can only be used within an injection ...
1
vote
0
answers
78
views
How to send HttpOnly cookies (refresh token) to ASP.NET Core backend on localhost?
I’m setting an HttpOnly cookie in the browser every time a user logs in or signs up on my website. This cookie contains a refresh token that I use to get a new access token.
The problem is that the ...
Best practices
1
vote
1
replies
33
views
Angular afterNextRender which phase to use with ResizeObserver
I am using a ResizeObserver to monitor an element's dimensions. When the size changes, I update a Signal (or state variable) that is bound to a CSS Variable in my template. This CSS variable then ...
1
vote
1
answer
99
views
How to install the latest Tailwind (v4) in an Ionic/Angular project
We'd like to install the latest Tailwind (v4) into our Ionic/Angular project so we can use its utility-first approach.
I've tried the guides mentioned here:
Angular guide
Capawesome guide
Workaround ...
2
votes
2
answers
143
views
+50
ng build crashes with heap corruption (exit code -1073740940) on Node.js 24 during Angular library compilation
After migrating to Angular CLI 20.3.6 and Node.js 24.0.0 When building an Angular library using ng build --configuration production library, the build process crashes sporadically with exit code -...
2
votes
1
answer
47
views
ngOnDestroy is not working inside ComponentPortal
I am creating a ComponentPortal for use in an overlay like so.
const myPortal = new ComponentPortal(MyComponent, null, Injector.create({
name: 'MyPortalInjector',
parent: this.injector, // ...
0
votes
1
answer
45
views
How to set if ag grid row is selectable
I have ag grid rows, a row can have 0 or many children. I would like to define selectable rows which are at level 0 (rows which don't have parent).
here is my column definitions :
{
columnDefs: [
...
Advice
2
votes
3
replies
88
views
@for adds whitespace nodes when preserveWhitespaces: true — is it equivalent to ng-container?
I’m testing Angular’s new control flow syntax @for with preserveWhitespaces: true, and I’m seeing different whitespace behavior compared to *ngFor.
Environment
Angular: 17+ (control flow syntax ...
-1
votes
1
answer
32
views
Angular Service Worker fetch fails after new release with CSP update (Geoapify / OpenStreetMap example)
After our latest Angular app release, which included a CSP update, some functionality broke, specifically related to map tiles.
Scenario:
The app was originally using Google Maps, which worked fine.
...
0
votes
0
answers
62
views
How to add Angular Interceptors after defining the initial interceptors?
I am maintaining ng-openapi, an open source library that generates API clients. I previously added a neat feature to enable client-specific HTTP interceptors.
The library currently uses the legacy ...
Best practices
1
vote
0
replies
51
views
NgRx Signal Store Architecture
I have some questions about ngrx signal store.
How can you let two different stores talk to each other?
Is there something similar to working with slices like in the ngrx store?
Are the new events ...
Best practices
1
vote
1
replies
64
views
Pass data to child components that are multiple levels deep
So I've got a page in my app that goes like this
<app-parent>
<app-child1>
<app-child2>
<app-child2-child1>
et cetera
And the parent contains many variables ...
1
vote
2
answers
89
views
Using NgxControlValueAccessor with [field] causes ERROR RuntimeError: NG0950: Input "field" is required but no value is available yet
I'm experimenting with Angular 21's new signal forms and tried using a component implemented with NgxControlValueAccessor with the new [field] directive. Using the custom control component with [field]...
0
votes
1
answer
118
views
Horizontal scrollbar reaches end but last table column is still not visible (Flex layout + scroll container)
I have a page layout with a fixed left panel and a right content area that contains a scrollable table.
The issue is:
The horizontal scrollbar reaches the far right
But one more column is still not ...
0
votes
0
answers
70
views
Angular SSR doesn't serve HTML
I added the Angular SSR boilerplate code to my existing Angular 21 project by using the schematics ng add @angular/ssr which generated the following files:
server.ts
main.server.ts
app.module.server....
2
votes
1
answer
141
views
Required input signal does not have a value
I have an Angular component with a required input signal which I use in the constructor:
export class ApplicationComponent {
protected key = input.required<string>();
constructor() {
...
0
votes
2
answers
119
views
DevExtreme DataSourceLoader SQL Error "Conversion failed when converting date and/or time from character string" with EF Core
I am building an ASP.NET Core Web API with an Angular frontend using the DevExtreme DataGrid. I encounter a SqlException when trying to filter my grid by a date column:
Microsoft.Data.SqlClient....
2
votes
1
answer
68
views
Highcharts Angular: adding a good range and a bad range color
I have a column chart implemented. Now, I have to add good range and bad range values for the same.
Good range and bad range both will have radio buttons to choose between '<' and '>' and an ...
3
votes
3
answers
137
views
How to do a http request for user details everytime the userID signal value changes?
I'm just getting used to performing http requests with signals in Angular 20.
I'd like a http get request to be executed everytime the profileUserID signal value (which I have defined in a user ...
1
vote
1
answer
109
views
How to implement a strict Content Security Policy with nonce using Apache and Angular (20.3) SSR?
I have spent the entire morning trying to implement a strict Content Security Policy (CSP) using nonces with Apache and Angular 20.3 SSR.
On the Apache side, I am able to generate a nonce correctly ...
2
votes
1
answer
96
views
NG0201: No provider found for `InjectionToken @ngrx/store Root Store Provider`
I have a basic setup of NgRX to learn the flow.
Now it gets to use the NgRX Effects, and my implementations throw error, Please review and let me know what may missed?
"dependencies": {
...
4
votes
1
answer
159
views
Object is possibly 'undefined' when using optional chaining with control flow
When using Angular's new(ish) control flow, you will get Object is possibly 'undefined' errors when accessing nested object properties after checking if they are truthy with Angular's control flow, ...
3
votes
1
answer
109
views
How to properly augment TypeScript module types without overriding other exports?
I have an Angular library that exposes a permission directive used to show/hide elements based on user permissions. The library defines a generic Permission type, but I want each application to define ...
0
votes
1
answer
63
views
How to make a listing dynamic inside of 2 loops in Angular
<ng-container *ngFor="let grup of secili.grupList; let grupIndex = index">
<div class="pb-2">
<div class="col-12 pt-0 border-1" style="...
1
vote
0
answers
82
views
Implementing a Chrome extension using Angular 21 and TypeScript [duplicate]
I’m trying to implement a chrome extension using Angular21. I need to compile background script, that is written using TypeScript. For this I need to compile background script inside Angular build. I ...
3
votes
1
answer
74
views
Angular Signals: effect() error when used in afterNextRender
Complete error : effect() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with runInInjectionContext
I have a simple ...
1
vote
0
answers
78
views
Unable to debug test
I've just moved from Jasmine and Karma to Vitest in my Angular 21 frontend project.
The migration went smoothly, and I now have all my tests running correctly inside a Chromium browser.
Here is my ...
0
votes
1
answer
99
views
Angular - API call made twice
Can someone explain to me why this code makes an API call twice? I'm using Angular 21 with SSR activated.
ngOnInit(): void {
if (this.appService.platform() === 'browser') {
const { ...
1
vote
0
answers
154
views
Angular Vitest not working in Test Explorer - Need to call TestBed.initTestEnvironment() first
Why is it that when I run Angular Vitest tests in the terminal is works fine:
But running the same tests in the Test Explorer fails:
I tried adding
import { BrowserTestingModule, ...
1
vote
0
answers
107
views
Why does a Micro Frontend component work only when standalone: true in Angular 19?
I am using Angular 19 with a Micro Frontend architecture (Project A = host, Project B = remote).
Everything works perfectly inside Project B itself.
However, when I load Project B from Project A, I ...
2
votes
1
answer
80
views
Angular CanDeactivate + browser back button breaks history after canceling navigation twice
I have an Angular (standalone) application with a CanDeactivate guard that prevents navigation when a form is dirty.
Reproduction steps:
Navigate to User Management
Click on a user (e.g. “Alice”).
...
4
votes
1
answer
94
views
Angular Reactive Form - patchValue doesn't work on Multiple Select field
Environment Angular 17.x
Setup:
The select form field has multiple enabled. The options are an array of objects - {_id, fullName, ...}. The option value is bound to _id.
Also added a function for the ...
2
votes
1
answer
95
views
AuthGuard is not working in my angular 15 application
I am trying to set AuthGuard for a user details component page. Without login user details page can not see. I am storing login details in localStorage.
If i add AuthGuard to user details component my ...
Advice
4
votes
6
replies
197
views
Is it possible to stream the creation of a zip file to a frontend web page? (C#)
I apologize if the title is confusing, but here's what I mean:
I have a large set of files, such as log files, and I want to put them all into a zip file and send that zip file to a frontend web page. ...
5
votes
1
answer
132
views
Angular doesn't update value using ngOnInit()
I'm consuming an API with Angular 21. I have a service that sends a http petition and returns it's response. However, I'm calling the service on my ngOnInit; when I start the app, it displays the ...
0
votes
0
answers
38
views
Angular SPA: AOS animations disappear when navigating away and back to a page
I'm using AOS (Animate On Scroll) in my Angular SPA with standalone components. The animations work fine when I first load the page, but when I navigate to another route and then return to the ...
Advice
0
votes
1
replies
80
views
Get sum of cells in table with dynamic rows and columns in angular
I'm trying to build an application that functions similar to an excel sheet for the purpose of saving monthly bill payments for tenants of an apartment complex.
The cell headers and rows will be ...
1
vote
1
answer
65
views
Dynamic form that has similar fields for each of the values of a dropdown
I'm having trouble implementing this kind of form. I want to build an app-management-like module in order for admins to adjust contents of the app (e.g. Products and Categories). However,
I want to ...