Angular signals are a new reactivity primite for Angular. They allow fine-grained reactivity.
Questions tagged [angular-signals]
30 questions
7
votes
2 answers
How to create computed signal from signal and observable?
Imagine standard situation in Angular:
You need to fetch data from server for some entity ID. Entity Id is a Signal and you want the fetched data to be signal too.
Something like this feels natural:
@Component({
selector: 'my-app',
standalone:…

George Knap
- 843
- 9
- 30
4
votes
2 answers
Angular signal effect doesn't execute unless signal.set is called as part of an interval
I'm rewriting an old directive I have to use signals instead of bloated RxJS but I'm facing an issue which I don't fully comprehend. This is the directive, which is a directly which listens for media query changes:
@Directive({
standalone:…

Chrillewoodz
- 27,055
- 21
- 92
- 175
4
votes
1 answer
How does Angular Signals affect RXJS Observables and what happens to change detection in this case
I am trying to switch to Signals in my Angular App and i currently have issues finding good practices and i also experienced (at least for me) unexpected behaviour.
This is a snippet of my code consisting of a userService and two Components
export…

Tilman Adam
- 41
- 3
4
votes
1 answer
Is there any sense already for using signals in Angular?
According to RFC3 signal-based components with change detection strategy based fully on signals are planned as next thing to be released. So as of now, with zone-based change detection strategy, is there any sense of using signals over the…

ThaFog
- 493
- 3
- 15
4
votes
4 answers
Will Angular Signals replace NgRx (a bit)?
I read a lot about Signals which will be released with Angular 16 and did already some coding with it. Pretty awesome!
I heard (and believe) it will probably replace almost all RxJs Code expect async related stuff like fetching an API.
My question:…

Peter Schuhknecht
- 147
- 1
- 4
3
votes
1 answer
Angular Signals - debounce in effect()
I have a signal that is bound to an input field. I'm trying to define an effect() for the searchTerm, but because it's user input, I'd like to debounce that effect (i.e. rxjs) so that the search doesn't happen with each keystroke. I'm unclear on how…

Layne Robinson
- 33
- 3
3
votes
1 answer
Angular Signals - computed signal based on input
I'm asking for opinions about my use-case.
very simplified example:
@Input() parentComponent;
childSignal = computed(() => this.parentComponent.parentSignal());
This code will throw runtime error because parentComponent is undefined when signal…

George Knap
- 843
- 9
- 30
3
votes
1 answer
How to cleanup once a signal is unused in Angular 16?
In RxJS several observable have cleanup function ran at unsubscription, such as timer(). I'm trying to understand what's the best approach to implement that in pure signal. Some of my attempts on stackblitz.
The below code shows how one could…

FunkySayu
- 7,641
- 10
- 38
- 61
3
votes
1 answer
Push in Angular Signals Array
Context:
With Angular 16, we can now use Signals.
But it doesn't seem clear to me how to do a simple push into an array.
The documentation suggests from Angular Signal official doc:
When working with signals that contain objects, it's sometimes…

Wandrille
- 6,267
- 3
- 20
- 43
2
votes
2 answers
EventEmitter vs signal
I just updated my application to Angular 16, which uses a lot of EventEmitter in a service to show where the user is in the app (setting Boolean values). signals were added in this release and I am trying to understand the benefits of switching. …

xinthose
- 3,213
- 3
- 40
- 59
2
votes
2 answers
Angular16 how to create a Signal without initial value
I updated my Angular app to v16 and I'm trying to use Signals. Before, I was initializing my variables without initial value
filters: Filter[];
but as I'm using Signals it gives me an error.
An argument for 'initialValue' was not provided
Is there…

farouk alahdab
- 21
- 3
2
votes
1 answer
Angular Signals - What is the advantage?
I am trying to understand the advantage of using Angular Singnals. There is a count example given in many explanations but what I am trying to understand is the advantage of using signals this way as opposed to the way I have done below via…

Ka Tech
- 8,937
- 14
- 53
- 78
1
vote
1 answer
Template doesn't update when Signal's value changes
My template:
{{ announcements().start | date: "d MMM" }} -
{{ announcements().end | date: "mediumDate" }}
My component:
export…

cooligus
- 15
- 6
1
vote
1 answer
Angular Signals - Using mutate() vs. Using forEach() Reactivity
Considering the following Angular Signals example, I'm somewhat confused about when I should use the Signal API, like mutate() and update(), when the Array API, such as forEach, is sufficient to trigger reactivity and update the UI/template? What is…

Okyo
- 357
- 4
- 17
1
vote
1 answer
I want to use Angular Signals, do I have to turn of zone.js?
With Angular 16 came Signals as Developer Preview.
When i want to use Signals, do i have to turn of zone.js. And if you so, is Signals taking place the job from zone.js automaticcly?

HOST-X
- 185
- 10