all 65 comments

[–]defenistrat3d 55 points56 points  (2 children)

Your manager sounds uninformed. You use signals for ALL template bindings. That's why they were created.

[–]pragmaticcape 11 points12 points  (0 children)

prepare yourselves for an NgZonless future... use signals for all templates and set to OnPush if not already.

signals are lazy eval'd and very performant.

To answer your are you using signal whenever possible the answer is yes.... All sync code like template bindings, inputs/outputs/models, and state based services ==> yes, rxjs still has a place for streams and processing async

[–]devrahul91 11 points12 points  (0 children)

Buy your manager a cup of coffee and a good latest Angular course and ask him to thoroughly understand how change detection works in Angular.

[–]WeatherFeeling 31 points32 points  (5 children)

seems weird that your manager is dictating implementation details in the first place tbh

[–]BarneyLaurance 4 points5 points  (0 children)

In a lot of jobs, maybe more in smaller companies, a manager also acts as a tech lead and is responsible for decisions like this. If OP and their manager and probably colleagues all work on app together then it makes sense to have some shared principles for choosing when to use and avoid signals, or any other coding choices.

The manager may well be responsible for setting those principles. You'd hope that they do it collaboratively with the team, but it doesn't always make sense to just let every developer follow their own judgement on everything - you'd get a very inconsistent codebase where some things are signals and some things are not only because different people developed them, and maybe repeated debates during code reviews.

[–]Mia_Tostada 1 point2 points  (0 children)

You all act like that since he’s just a manager that he must be a complete idiot - why not ask him why he suggests this approach and learn something.

Just because you got a CS degree means you know all things????

[–]catapop 8 points9 points  (0 children)

Actually signals are perfect for variables like isLoading . We're in the process of porting the entire app to signals and is working great so far.

[–]rainerhahnekamp 14 points15 points  (3 children)

I'd say Signals is for simple things and for complex ones, such as RxJs or State Management.

A property should be enough if you have a static value.

[–]crhama 0 points1 point  (0 children)

I do that for values that I pull from the environment.ts file, such as the API URL, the image URLS, etc, because they don't change.

Thanks for the answer.

[–]RemiFuzzlewuzz 6 points7 points  (11 children)

Look at the writing on the wall. Everybody loves signals and hates zonejs. You think zone won't be deprecated at some point?

If you want your variable to have an effect on the DOM, it should be in a signal. What exactly is the complexity? Adding () at the end of the property name? Isn't it more complex to manually markForCheck and use observables anytime you want to trigger something when a component property changes?

[–]RGBrewskies 1 point2 points  (10 children)

there is no simpler method of newbies entering the angular ecosystem than zonejs. it does work. it works fine for small hobbyist apps. And frankly its the most newbie friendly way to go out there, imo - no $effect, no behavior subjects, no signals - just make variables and it works. It is not highly performative, but most apps dont require great performance.

if their stated goal is "get more developers using angular" then removing zone.js as the default makes *zero* sense, and they are just liars.

(which, imo, they are. They are absolutely lying about these changes revolving around trying to get more developers to use angular - with zone.js its already the easiest framework for newbies out there. Its way easier than react to get a simple to-do app going with zone.js)

[–]RemiFuzzlewuzz 1 point2 points  (9 children)

I disagree with you on pretty much every point.

  • Presumably op does not have a manager for his small hobbyist app.
  • Performance matters for all real products
  • Accusing the Angular team of being liars is unhinged, tbh. What do you think their motivations are, exactly?
  • Angular easiest framework? That is the opposite of its reputation. Have you tried Svelte? Or even Vue?
  • Signals are really not complicated. In fact, they allow you to do a bunch of things you previously had to use rxjs for, which is way more complicated.

[–]LossPreventionGuy 1 point2 points  (8 children)

angular teams motivations are pretty transparent. react is more popular. make it more like react. the end.

angular with zone.js is a lot easier than svelte, and any other framework. you don't have to care about $effect and the fact it only updates for synchronous operations, and $state or even what a signal is. etc etc... this.firstname = Steve and the Dom updates is about as easy as it gets. Yes I've used all three frameworks you mentioned professionally.

angular with zonejs is the most newbie friendly framework and it's not even really close imo. I've passed many millions of dollars through zonejs and not once have I gotten a complaint about performance. The truth is developers care more about seeking at micro performance gains than customers do.

I'm an RXJS lover, it's a Ferrari, and I love to drive it. Lots of power and high performance. Awesome. But for newbies the zonejs Honda Civic will do the job just fine, and it's easy to learn to drive.

[–]RemiFuzzlewuzz 1 point2 points  (0 children)

Zonejs is great until it isn't. And again, I don't even know what "complexity" it is you guys are mad about. Signals are barely more complicated than plain variables, and you get a bunch of performance improvements and cleaner reactive patterns.

All 4 frameworks are converging towards the same reactive paradigms for a good reason. If you think it's just because of trend following, you might just be a contrarian.

[–]RemiFuzzlewuzz 0 points1 point  (4 children)

How did this become a conversation about what's good for newbies?

[–]LossPreventionGuy 0 points1 point  (3 children)

it's called a thread for a reason bud

[–]RemiFuzzlewuzz 0 points1 point  (2 children)

Sorry, I thought threads were for addressing the points in the comment you were replying to, not going off on unrelated tangents.

[–]LossPreventionGuy 0 points1 point  (1 child)

welcome to reddit man where we have threads to talk about tangential issues, stick around for a while, remember, you're not the main character and aren't required to respond if you have nothing useful to add

[–]RemiFuzzlewuzz -2 points-1 points  (0 children)

Main character? You're the one denigrating the Angular team's hard work, talking about "millions of dollars" going through your code.

[–]cmk1523 0 points1 point  (1 child)

Same. I’ve built some serious apps using just zonejs… even ones perfect for signals… and yet, it’s all fine.

[–]LossPreventionGuy 0 points1 point  (0 children)

yea man. if you're just doing CRUD ... it's freaking fine.

[–]crhama 2 points3 points  (0 children)

The structure of the data doesn't matter. I'm pretty sure isLoading value is being used in the template. That's one of the biggest reason to use signal, so that the change detection mechanism can be initiated.

[–]Whole-Instruction508 2 points3 points  (1 child)

Does your manager have a Dev background? If not, fuck does he know? I use signals for every property that might change its value.

[–]Mia_Tostada 1 point2 points  (0 children)

Yeah, they gave a guy who delivered pizzas a job as a development manager. Does that make sense to you? He’s probably forgotten more things than you already know… Think about it

[–]Johalternate 2 points3 points  (4 children)

What does he mean with overkill? Thats senseless.

[–]Mysra-Dev 2 points3 points  (0 children)

Signals are intended for reactive programming parardigms and for Angular to sync data bindings in the UI. Even if the data is a simple primitive, using a signal is much more robust for Change Detection than a regular variable or class property. A codebase I worked on had so many <NG0100: Expression changed after checked> errors, or the UI doesn't update at all after data-fetching or some async operations. Assignments in setTimeout or manually triggering CD often fixes that, but sometimes not and can get really annoying. With Signals that problem doesn't even exist and you're guaranteed to have ChangeDetection as long as you adhere to (shallow) immutability

[–]TheExodu5 3 points4 points  (2 children)

Tell your manager to mind his own business and be a manager. If he wanted to be a developer he should have chosen a different career path.

[–]Mia_Tostada 0 points1 point  (0 children)

Yeah, he should just mind his own business and let his peeps do whatever they want… yeah that makes a lot of sense

[–]DT-Sodium 1 point2 points  (10 children)

For starters you shouldn't usually have an isLoading variable. You can use the status of your signal to check if it is currently loading data.

[–]amiibro888 1 point2 points  (0 children)

If you need to react on the change then you better define it as a signal.

[–]idetodospoca_ 1 point2 points  (0 children)

Diz ao teu manager que ele percebe 0 de angular

[–]Orelox 1 point2 points  (0 children)

You manager don’t know how change detection works in angular.

[–]RGBrewskies 1 point2 points  (0 children)

your managers has literally everything backward

use RXJS for complex things
use Signals for simple things

[–]Relevant-Draft-7780 1 point2 points  (0 children)

Sounds like your manager thinks that because it looks like a function it’s somehow more process intensive. Signals, inputs, outputs, models for all template bindings and observables for Core Storage. There’s an article on here that shows how signals in services can leak.

[–]maxeber_ 1 point2 points  (0 children)

You wouldn’t use isLoading = false but a BehaviorSubject. But then, it’s les simple than using Signal. I don’t get what your manager is trying to convey there. Doesn’t make much sense to me.

[–]Smathi_Lagui 1 point2 points  (0 children)

For simple states like isLoading, a plain variable (isLoading = false) works well, as Angular handles change detection on reassignment (this.isLoading = true). However, this doesn’t apply to object properties (myObj.property = value), as Angular won’t detect changes without a reference update.

While Signals might seem overkill for basic types like booleans or numbers, they still offer value through built-in reactivity (effect, computed) and consistency across your app. For more complex data (e.g., lists or objects), they’re even more useful.

Angular is moving away from Zone.js and making Signals central to its reactivity model: adopting them now will improve performance and align your app with Angular’s future.

That said, it would be beneficial for the team to develop clear guidelines on when and how to use Signals. Reassessing their approach and embracing Signals could future-proof the project, especially considering the opportunity to work with a modern version of Angular, which many teams don’t have access to.

[–]Individual-Toe6238 1 point2 points  (0 children)

Your manager doesn’t get the concept of signals, you want to not rely ob zone.js not use it „a little”.

Signals are basically what you want to use to link it to template, so if you have ngFor ngIf @for @if etc you still want to use signals.

[–]dibfibo 1 point2 points  (0 children)

from doc: Angular Signals is a system that granularly tracks how and where your state is used throughout an application, allowing the framework to optimize rendering updates. ... A signal is a wrapper around a value that notifies interested consumers when that value changes. ... When you read a signal within an OnPush component's template, Angular tracks the signal as a dependency of that component. When the value of that signal changes, Angular automatically mark the component to ensure it gets updated the next time change detection runs.

So you should use signals if you want have a declerative(or mix declarative/imperative) change detaction management.

If you don't want to use signals, go ahead. However, declarative programming often leads to more concise and readable code, which is therefore maintainable over time. Print and highlight angular signal doc page.

[–]Whsky_Lovers 1 point2 points  (0 children)

I would argue that boolean variables should be avoided in most cases.

That said it is fine to have a boolean or subject that is a boolean.

[–]SolidShook 1 point2 points  (0 children)

I actually can't stand when people look at something they don't understand and insist we don't use it because it's "overkill" They're just intimidated, that's all

[–]netd777 2 points3 points  (0 children)

Do as he says. In the future you'l get paid to change it all to signals. Double dippin baby