Skip to content

InjectQueryParams.required for single value #659

@montella1507

Description

@montella1507

Hi,

we would like to be able to have this:

// Signal
id = injectParams.required('id');

rather than this
// Signal<string | null>
id = injectParams('id');
// nd then in template to do:
id()!

or this:
id = injectParams<string>((params)=> params['id'] as string);

to get correct typing for required route parameters. To get correct typing without need to define parse / serialize options

I am wiilling to provide PR.
So this issue is more for having a discussion about this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions