mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
f877b544a7
There was an interesting issue that surfaced in the type checking tests. Previously an input was type-checked using an expression like: ```ts myDir.input = myrDir.input2 = userExpr ``` Note how the user expression was only specified once. With signals for type-checking we cannot do this because both inputs cannot use the same expression unless we extract it into a separate variable. This is what this commit implemements. ```ts const x1 = userExpr; toWriteableSignal(myDir.input).set(x1); toWriteableSignal(myDir.input2).set(x2); ``` Note: Even if no input is bound, due to e.g. the `inputs` decorator field being used and no statically analyzable class member being discoverable- the user expression should be *evaluated*. This was something we broke with the initial signal input prototyping.