Skip to content

Pipe generated transform method has wrong parameters #12602

Closed
@tchatel

Description

@tchatel

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

All versions are affected, including v7.0.0-rc.3.

Repro steps

ng generate pipe ...

Problem

The generated method transform has wrong parameters. The second parameter, args, will not receive all the pipe arguments, but only the first one, and other arguments are lost.

The generated method is:

transform(value: any, args?: any): any {
  return null;
}

A right version should be:

transform(value: any, ...args: any[]): any {
  return null;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions