blog/new-angular-coding-style #21
Replies: 5 comments 4 replies
-
|
Thanks for the blog; I appreciate the knowledge! I have a question: Do you use readonly in your variable declarations, most for service injection? I've made it a habit to always include private readonly for my services or any variables that don’t change. Do you think it’s really necessary, particularly for service injection? |
Beta Was this translation helpful? Give feedback.
-
|
What a great article! Thanks for sharing it. |
Beta Was this translation helpful? Give feedback.
-
|
Nivek, you have a broken link to your GitHub's account |
Beta Was this translation helpful? Give feedback.
-
|
When we were migrating some more complex components involving ngOnChanges with checks related to previousValue and currentValue which were later executing side effects, such as writing to backend user settings storage, we had some pretty tough time reimplementing that to Signals, the only thing we came up with was using an effect and assigning previous value to a separate private signal. So in current state of affairs, I wouldn't say that computed or effect (easily) replaces ngOnChanges. |
Beta Was this translation helpful? Give feedback.
-
|
Dude! Assigning effects to a variable changed my life! That’s brilliant because it allows us to extract "React-like hooks" as pure functions and reuse them! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
blog/new-angular-coding-style
Embracing the New Angular: A Fresh Perspective on how to write Angular code.
https://angularexperts.io/blog/new-angular-coding-style?ref=dailydev
Beta Was this translation helpful? Give feedback.
All reactions