Skip to content

HttpParams fromObject should accept ReadonlyArray<string> #28452

@jinder

Description

@jinder

🚀 feature request

Relevant Package

@angular/common/http

Description

The type definition for HttpParamsOptions fromObject property only accepts string and string[]. If using immutable types, such as ReadonlyArray, you must create a new array unnecessarily to satisfy the type.

Describe the solution you'd like

Please change the type to the following (which is backwards compatible):

    fromObject?: {
        [param: string]: string | string[] | ReadonlyArray<string>;
    };

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions