Why signal INPUTS in Angular are such a big deal

Why signal INPUTS in Angular are such a big deal

Joshua Morony

5 месяцев назад

13,847 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@brandongregori995
@brandongregori995 - 25.01.2024 22:13

As far as I can tell, you have no access to the previous signal value in `effect`, which means you can't perform operations that need to compare the old value with the new one. `ngOnChanges` allows you to do this. If that's the case, then this feels like an incomplete solution, though I'm sure it still fits for the vast majority of use cases.

Ответить
@kkkheladze
@kkkheladze - 22.01.2024 12:54

Hey, I'd like to have your opinion on this - Why do you think InputSignals don't have .update and .set properties?
In my use-case I have a bunch of shared components. For example - TableComponent receives list of entries, appends 'checked' and 'selected' props to them and then the table will handle the logic of selecting and checking those entries, although with these inputs it's not possible since they are read-only.
My work around right now is to use set functions like you have in the video.

Ответить
@pravinmane1
@pravinmane1 - 18.01.2024 21:34

Thank you for this informative video, I wanted to know if this is a stable change or in experimental phase?

Ответить
@shariar13877
@shariar13877 - 18.01.2024 21:26

Sooooo nice

Ответить
@LarsRyeJeppesen
@LarsRyeJeppesen - 18.01.2024 11:27

Here we go, 17.1 is out

Ответить
@GdeVseSvobodnyeNiki
@GdeVseSvobodnyeNiki - 18.01.2024 00:55

Fucking finally!

Ответить
@Elliott_Ives
@Elliott_Ives - 17.01.2024 23:20

Perhaps my biggest gripe with Angular as someone who has an equivalent level of React experience is how clunky component composition and "prop" usage has been in Angular due to the non-reactive nature of the input decorator. This is one of the largest usability enhancements ever. Nice!

Ответить
@urchuk2006
@urchuk2006 - 17.01.2024 22:19

We can pass observable as an input, like here:
<app-test [isMoreUsers$]="isMoreUsers$"</app-test>
@Input() isMoreUsers$: Observable<boolean>;

But his approach is often considered not good. What's the main issue with it?

Ответить
@turbowagon25
@turbowagon25 - 17.01.2024 22:04

Before 7.1, can this be simulated by doing something like this without the need for the set operator?

@Input({ required: true }) messages!: Signal<Message[]>;

Ответить
@ToJak91
@ToJak91 - 17.01.2024 21:23

Do i still need the @input()? (which i like.. Tells me how i can expect how it can be have)

Ответить
@VK-sn3sn
@VK-sn3sn - 17.01.2024 20:17

What about the performance?? React is way better than these changes. I would prefer React over Angular.

Ответить
@3pleFly
@3pleFly - 17.01.2024 19:53

smooth 😄

Ответить
@AlainBoudard
@AlainBoudard - 17.01.2024 16:30

That combined with router inputs and the rxjs interop, it does look good !

Ответить
@tsenguun
@tsenguun - 17.01.2024 16:03

love this change!

Ответить
@rStudius
@rStudius - 17.01.2024 16:01

I believe in passing an observable | async in the input. So every change will be reflected

Ответить
@BrettCoffin
@BrettCoffin - 17.01.2024 15:52

Brilliant

Ответить
@eoz
@eoz - 17.01.2024 15:50

Well, it is quite a stretch to call it imperative (signal input just reduces the boilerplate in comparison to the setter, but technically does the same thing), but there is a much more important difference: signal input gives you “the single source of truth” - no other code can write to that signal.

Ответить
@paulh6933
@paulh6933 - 17.01.2024 15:36

have u heard whether it will experimental or production?

Ответить
@lucmon98
@lucmon98 - 17.01.2024 14:26

Angular is getting easier and easier. I really liked it. Started Angular 2 years ago and seeing some headache goes makes me happy :D

Ответить
@codeSurvivor
@codeSurvivor - 17.01.2024 14:25

Very happy this is finally landing! One question Josh or anyone here, what do you think about the ngrx/signals lib? I've been checking it out and it seems really powerful and fully declarative...

Ответить
@CodeZakk
@CodeZakk - 17.01.2024 14:16

hi when does the .ng is release did they mention that its going to be a game changer. like .vue file it should support html and css autocomplete!!

Ответить
@joepfohl5259
@joepfohl5259 - 17.01.2024 14:16

Soooo much cleaner!!

Ответить