Skip to content

A pipe used in a host attribute is not found unless registered in parent component #5388

@mhelvens

Description

@mhelvens

When I use a pipe in the context of a host attribute, as in the example below, it cannot be found even if I register it in that component:

@Component({
  selector: '[with-parenthesized-text]',
  host: {
    '[inner-html]': ' myText | parenthesize ' // <-- (1) using pipe here
  },
  pipes: [Parenthesize], // <-- (2) but registering it here is not enough
  template: ``
})

It results in the error: Cannot find pipe 'parenthesize'. It seems the pipe needs to be registered in the parent component. I suspect this is not intended behavior.

Here is a simple plunker to illustrate the issue.

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