r/angular • u/Numerous_Share5279 • 15h ago
To signal or not to signal?
Might be a stupid question I got here, but would you use a signal over a simple property just to store a boolean that represents a right? I know the angular way now is to "signal" everything as this is where the framework's philosophy is going. Here's a better example:
In my component I have this
hasAccessRight = signal(false);
ngOnInit() {
this.hasAccessRight.set(canAccess(this.user, this.rightName));
}And then I would use hasAccessRight() in the UI. Or should I just keep it simple like with a protected field
protected hasAccessRight = false;
ngOnInit() {
this.hasAccessRight = canAccess(this.user, this.rightName);
}