Armen Vardanyan
banner
armandotrue.bsky.social
Armen Vardanyan
@armandotrue.bsky.social
GDE for Angular, front-end team lead. I write articles and talk at conferences
No idea for plain objects, but for signals you can just use and effect
December 10, 2024 at 9:26 AM
You could do a mapping in an if statement

But of course the API's gonna be refined
December 2, 2024 at 3:35 PM
Good catch, but it can also be mitigated with RxJS (I just forgot to put that logic 🤣)
December 2, 2024 at 3:12 PM
Yeah, but in general, the scenario can be more complex
December 2, 2024 at 3:11 PM
Good approach actually - if it's one case, do the mapping here, if multiple - use computed
December 2, 2024 at 12:15 PM
I might want to use that exact mapped value always. So it makes sense to compute it, not set.

But you're correct, it is a writable signal
December 2, 2024 at 12:14 PM
Ah, right, my example just specifically targeted ngModel, but it is applicable to that case too
November 28, 2024 at 5:50 PM
I don't think you can use it "instead of ngModel", rather than "with" ngModel, sid you mean that?
November 28, 2024 at 4:52 PM
Reasonable approach!
November 28, 2024 at 1:42 PM
Good use case actually!
November 26, 2024 at 5:10 PM
Thank you! I have a new similar one now, but brown 😁
November 26, 2024 at 2:23 PM
Yep, maybe we should submit an issue or something 😁

Thanks for explaining!
November 25, 2024 at 2:31 PM