Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
22 views

I have implemented a simple custom control using Angular 21's new FormValueControl, see StackBlitz: export interface Test { booleanValue: boolean; stringValue: string; numberValue: number; } @...
Peter T.'s user avatar
  • 3,437
Best practices
0 votes
0 replies
25 views

When building a component that uses Signal Forms to edit an object, the object needs to be loaded and then updated into the formModel. I want to use a pure Signal/Resource solution as opposed to using ...
muttonUp's user avatar
  • 6,787
1 vote
2 answers
116 views

I have written a very simple component that implements FormValueControl and uses a signal form internally, see below: import { ChangeDetectionStrategy, Component, model } from '@angular/core'; import ...
Peter T.'s user avatar
  • 3,437
-3 votes
0 answers
74 views

I'm experimenting with Angular (with signal and inject) and I'm trying a pattern where a service acts as a small state manager: The service holds the state in signals (loading, error, items, etc.). ...
michelemalagnini's user avatar
Best practices
1 vote
1 replies
54 views

I have the following in an older Angular app. newTask: Task = { id: 0, description: '', completed: false, priority: Priority.Normal }; <div> <input [(ngModel)]="...
Maarten's user avatar
  • 11
1 vote
3 answers
86 views

In my code I am trying to get the result from this observable: // Runs fine obtenerOfertaPorId(id: number): Observable<Oferta> { return this.http.get<Oferta>(`${this.apiUrl}${this....
Horacio García Magallanes's user avatar
1 vote
1 answer
86 views

I’m using Angular 21’s new Signal Forms. I have a search form where the user types a query, receives a paginated result list, and can move between pages. When the user changes the search phrase, I ...
Tom S's user avatar
  • 715
0 votes
2 answers
79 views

I'm trying to migrate a simple template-driven form to use Angular Signals. I’m on Angular 19 (standalone components, using FormsModule) and I would like to: Keep one object for the product (product) ...
aljaž aljaž's user avatar
1 vote
2 answers
269 views

We're starting to look at Angular 21's new signal-based forms, but I can't find a clean way to define default values for each form field, especially when building forms for objects where multiple keys ...
Peter T.'s user avatar
  • 3,437
1 vote
0 answers
86 views

Background: I am working on an Angular 20.3.10 application where I use signals for managing the state of a collection of toast messages. I have SSR and Zoneless enabled and have a web worker ...
Asad Koths's user avatar
Best practices
1 vote
3 replies
95 views

It is good practice to use signals in templates and bad practice to use methods. But signals and methods? Example (using the get method from Map): userStatuses: WritableSignal<Map<string, string&...
Mat's user avatar
  • 147
2 votes
1 answer
134 views

In angular, if I have an effect which calls some method which further on sets some other signal, will that effect be bind to that "other signal" or just signals called directly inside the ...
Slaven Tomac's user avatar
  • 1,572
1 vote
1 answer
48 views

Let's assume you have the following code: $mySignal = signal<number | undefined>(1) @if ($mySignal()) { <foo [item]="$mySignal()"></foo> } I got: Type 'number | ...
Raphaël Balet's user avatar
1 vote
1 answer
64 views

I'm currently running into an issue/question about optional chaining in Angular. I'm running Angular 20, with "strictTemplates": true enabled as angularCompilerOptions and "strict":...
Dennis's user avatar
  • 11
0 votes
1 answer
108 views

I am stuck with above error. [NG8: Type 'Signal<User[]>' must have a '[Symbol.iterator]()' method that returns an iterator.] I am using ngrx/signal-store for data management with my angular app. ...
3gwebtrain's user avatar
  • 15.5k
0 votes
2 answers
122 views

Interface: export interface User { userId: number; userName: string; emailId: string; role: string; } export interface UserState { users: User[]; _users: User[]; } export const ...
3gwebtrain's user avatar
  • 15.5k
2 votes
1 answer
88 views

I created this simple component that has two inputs that both accept a string and in theory should accept undefined because they have a default value. @Component({ selector: 'app-child', imports: [...
Ruben's user avatar
  • 181
2 votes
1 answer
80 views

I'm refactoring an Angular component to use signals throughout, but I'm stuck on how to properly initialize a signal that depends on required inputs without using ngOnInit. I am trying to see in this ...
Eternal Sunshine's user avatar
1 vote
2 answers
174 views

Here's the StackBlitz showing the problem. I have a reactive form with an Email field and Send Verification Code button. When the code is sent, the Verification Code field appears, so the user can ...
AlexB's user avatar
  • 4,684
2 votes
1 answer
55 views

I am trying to generate dynamic forms based on a set of questions I receive from an API. When the app inits I will dispatch a state action that will call the mock API to get the questions and then the ...
Sam Redmond's user avatar
2 votes
2 answers
641 views

I have an Angular 20 application with a Component that fetches logs from a bookService based on a required Input. The service returns an Observable. I tried to transform the Observable from the ...
adrianus's user avatar
  • 3,241
1 vote
1 answer
82 views

I have been playing with Angular Signals for a while. Recently I encountered a problem that I can fix but it felt not nice. I have a array of items and each time the count goes up, I need to show an ...
Maarten's user avatar
  • 11
2 votes
1 answer
74 views

Using Angular V18. Attempting to use the @for loop to render multiple child components, but receiving error "Type 'InputSignal<LoopTile[]>' must have a 'Symbol.iterator' method that returns ...
Vladmere's user avatar
-4 votes
1 answer
274 views

When I subscribe and update the signal getting error as follows. Error detail: ERROR RuntimeError: NG0602: toSignal() cannot be called from within a reactive context. Invoking toSignal causes new ...
3gwebtrain's user avatar
  • 15.5k
1 vote
1 answer
120 views

I am new to Angular. I started with Angular 19 that were using zone.js for change detection. But then I moved to Angular 20 and now I am using zoneless. I have a put method call that I am trying to ...
Basit's user avatar
  • 8,770
2 votes
1 answer
139 views

httpResource got released as an experimental feature in Angular 19.2. The httpResource uses the HttpClient under the hood. So I was hoping, I would be able to pass all the options I could pass to the ...
T. Jami's user avatar
  • 1,169
1 vote
1 answer
125 views

I have a component in my Angular project (v18.2.13) that has a reactive form to change a price field & an observable with the product info. I want to make a signal to know if the price form field ...
Oscar Saro's user avatar
1 vote
2 answers
95 views

I have a reusable angular component that handles cursor based pagination. However, the select value never changes on the HTML side, yet the change detection works. Example, select options are 10, 25, ...
kibet's user avatar
  • 435
1 vote
1 answer
243 views

I am trying to understand the new Angular resource API. One typical problem is to fetch several HTTP endpoints, combine the data and use it. My current approach looks like this: name = rxResource({ ...
Mo3bius's user avatar
  • 672
1 vote
1 answer
95 views

I'm working with a SSR Angular 20 and noticed Resource could be called twice : Here's an example of the code: Service: code = signal<string | undefined>(undefined); authCode = resource< { ...
Ncls7523's user avatar
2 votes
2 answers
224 views

I have this input: customHTMLContent = input<string>() In my HTML template calling this works: <p>{{ customHTMLContent }}</p> And this doesn't: <p>{{ customHTMLContent() }}&...
AirKlisa's user avatar
  • 143
1 vote
1 answer
243 views

I am working in Angular using the new signals API. I have an input signal that I am reading to create other computed signals, and am also directly reading inside of a template, like so: Template: <...
MacroProcessor's user avatar
1 vote
1 answer
423 views

I'm doing the following, which works as expected. <ng-container *ngComponentOutlet=" step.component | async; inputs: { someId: someId, stepper: stepper, step: step, ...
Konrad Viltersten's user avatar
2 votes
1 answer
495 views

Does Angular have any guidance where I should put the Effect code? Is it generally inside Constructor or outside? What are the advantages / disadvantages for each method? export class CustomerForm { ...
mattsmith5's user avatar
  • 1,357
1 vote
1 answer
109 views

In the docs for Angular host directive, it's stated that I can use my inputs/outputs in the template like this. @Component({ ... template: "ID {{someId}}", hostDirectives: [ { directive: ...
Konrad Viltersten's user avatar
1 vote
1 answer
434 views

To update items into an immutable array, we can easily do: array = signal([1,2,3]); ... ... this.array.update(item => [ ...item, 'newItem' ]); To update items into an immutable object easily do: ...
Juergen Gross's user avatar
0 votes
1 answer
94 views

I’ve built a signal store that includes all the necessary methods. Component A In this component, I have a navigateToUser() function where I call this.userStore.loadUser(). This method makes an API ...
Harish Redyshetty's user avatar
2 votes
1 answer
485 views

In the html, I have to iterate over a WritableSignal object variableList(), but this html code will not run the loop unless the json string of the variableList() will show correctly in the same html. ...
Juergen Gross's user avatar
4 votes
1 answer
92 views

I am struggling with a simple plain object, which is itself a property of AppComponent. This object "x" is wrapped as a writable signal. I want to implement a method which updates the own ...
Juergen Gross's user avatar
3 votes
1 answer
124 views

What is the correct implementation for an object in the signal world of angular? A) all wrapped with signal as: length = signal({ nominalValue: signal(0), unit: signal ("mm") }) B) ...
Juergen Gross's user avatar
2 votes
1 answer
95 views

I have to mange a relation for X*2=Y, there Y and Y are input fields. In the moment, I trigger by a change of the input field the related variable as X changed => Y=X*2 Y changed => X=Y/2 import ...
Juergen Gross's user avatar
1 vote
1 answer
151 views

This might be a common problem but somehow i keep hitting wall with it HTML @if(data$ | async; as data) { <span>{{data.status}}</span> } TS dataId = input.required<string>(); data$ =...
Aeseir's user avatar
  • 8,590
0 votes
1 answer
107 views

I have a component that fetches some information from a NGXS Store, that I need to create unit tests for. The component looks like this: @Component({ standalone: true, selector: 'app-task-...
gizmo's user avatar
  • 131
1 vote
1 answer
202 views

I'm using Angular 17+ with signals, and I ran into a problem when trying to control a <mat-sidenav> via a shared service and @ViewChild. I created a SidenavService that exposes a signal, which ...
Kate Vel's user avatar
2 votes
1 answer
104 views

I've made a set of interfaces which describes JSON data. Then I used classes to compose the same data but as Angular Signals: // TToSignal.ts import { WritableSignal } from '@angular/core'; export ...
Mateus AJ Leon's user avatar
1 vote
1 answer
250 views

I'm using Angular (v20) with Signals and httpResource from @angular/common/http to manage my user's state and authentication. My AuthService exposes a currentUserResource that loads user information ...
erwan's user avatar
  • 453
1 vote
1 answer
171 views

This is actually a follow-up question of Is there a way to dynamically compute rxResource() or resource() in Angular (19) We have a list of queries that is computed based on some component state. We ...
Peter T.'s user avatar
  • 3,437
1 vote
2 answers
70 views

I need the LAST emission to call signals.onResponse(), thus the tap, so that my deep chat ui completes and re-enables the submit button after last message. I have to hack deep chat and use the ...
DRNR's user avatar
  • 463
2 votes
1 answer
133 views

I have an input signal which I take and set as attribute but in browser I see an error this.width is not a function export class SkeletonComponent implements OnInit { readonly width = input<...
Sunstrike527's user avatar
0 votes
1 answer
79 views

I am using this package, ang-jsoneditor, which contains the below initialization code. @Component({ ... }) export class AppComponent { public editorOptions: JsonEditorOptions; public data: any; /...
Naren Murali's user avatar
  • 66.3k

1
2 3 4 5
8