angular-signals Questions

3

Solved

I have a component that takes two inputs, user and userList I wonder should i detect the change with the ngOnChanges lifecycle hook? What's the best practice for that? // Note: Old approach // @I...
Dominican asked 12/4 at 10:38

4

Solved

In Vue.js, the watch function gets the new and old watched value passed as arguments, which is really helpful in case the differences matter, or when I want to release the previous allocated resour...
Septicemia asked 8/5, 2023 at 12:27

5

Solved

In a app-test component I have the following: @Input( { transform: booleanAttribute}) reverse: boolean = false; @HostBinding('style.flex-direction') direction: string = this.reverse ? 'column-...
Malraux asked 25/2 at 3:41

5

Solved

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 do...
Senior asked 2/7, 2023 at 3:31

2

Solved

Let's say I have a simple component with signal input introduced in Angular 17.1 @Component({ selector: 'greet', template: ` <span class="greet-text">{{firstName()}}</span>...
Culture asked 18/1 at 9:27

0

I am enthralled with Angular Signals, exactly what I want out of the library, but one thing that I have commonly found is that I accidentally am calling a signal reference somewhere (in a template ...

2

Solved

I am new to signals in angular and i want to change my input signal from within component selected = input(false); I would except to do somethin like this this.selected().set(true) this.selected.s...
Potted asked 2/2 at 17:2

3

In the following mock-up I use a signal as an input to a component. It works. But I am wondering if this is the proper use of a signal. Seems....weird. The follwing is a service that maintains a li...
Towelling asked 26/7, 2023 at 18:59

0

I've been looking for information on how to test NgRX singalStore I use in my project. Unlike @ngrx/store, there is no documentation regarding testing (store testing link). With presented code: exp...
Ruthanneruthe asked 2/1 at 16:38

1

Solved

Related to but not the same as Difference between Constructor and ngOnInit. In Angular 16 and 17 we can now use the takeUntilDestroyed operator and Signals. Both of these seems to work best in an I...
Softpedal asked 29/11, 2023 at 9:47

3

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...
Chitter asked 7/5, 2023 at 12:54

3

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 expe...
Scuttle asked 16/4, 2023 at 13:23

2

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 ar...
Marinemarinelli asked 5/5, 2023 at 10:11
1

© 2022 - 2024 — McMap. All rights reserved.