We know that from Angular v.17 we can create a signal using the following syntax:
And we have seen how we can create derived states by using computed properties:
Example
In the next snippet we define a countersignal that is incremented by 1 at each click of the increment button.
We also create a computed property, double, representing the value multiplied by 2.
computed are not writable!
However the computed properties are not writable and therefore in the following example, when we (try to) set its value to 0 we receive a compiler error that notifies us that the set method is not available:
Here's the full source code (that won't work because of the reset method):