Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

support Signal Function without argument (undefined implied) #64118

Open
@hannah23280

Description

@hannah23280

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp