Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Currently, signal () function expects an argument to be passed in, even if the argument is undefined
Current Situation:
name = signal<string| undefined>(undefined)
Proposed solution
To allow no argument for signal function. In such case, undefined will be assumed.
This aligns with the input() function, where no argument implies undefined
Proposed Enhancement
name = signal<string | undefined>()
Side note: I do wish typescript has a way for us to condense "string | undefined" to become something like "string?"..but that is a separate matter.
Alternatives considered
Nil
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Currently, signal () function expects an argument to be passed in, even if the argument is undefined
Current Situation:
Proposed solution
To allow no argument for signal function. In such case, undefined will be assumed.
This aligns with the input() function, where no argument implies undefined
Proposed Enhancement
Side note: I do wish typescript has a way for us to condense "string | undefined" to become something like "string?"..but that is a separate matter.
Alternatives considered
Nil