-
Notifications
You must be signed in to change notification settings - Fork 27.2k
signals: TypeScript and nullability #49161
Copy link
Copy link
Open
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: reactivityWork related to fine-grained reactivity in the core frameworkWork related to fine-grained reactivity in the core frameworkcross-cutting: signalscross-cutting: types
Milestone
Metadata
Metadata
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: reactivityWork related to fine-grained reactivity in the core frameworkWork related to fine-grained reactivity in the core frameworkcross-cutting: signalscross-cutting: types
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
In Progress
Which @angular/* package(s) are the source of the bug?
core, Don't known / other
Is this a regression?
No
Description
The current implementation of signals uses a function to access the value, and TypeScript has issues with type guards in that case:
This can be workaround by storing the value in a temporary variable or with an explicit cast, but this could be a bit cumbersome, as I imagine the same would happen with
ngIfin templates:Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version)No response
Anything else?
No response