I'm submitting a ... (check one with "x")
[ ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ X ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request
Current behavior
Sorry, let me try this again with a better question. I have a component with the following:
import { Component, Input, OnInit } from '@angular/core';
import { TranslateService, TranslatePipe } from 'ng2-translate/ng2-translate';
@Component({
selector: 'home',
template: `
<h2>{{'HOME.TITLE' | translate}}</h2>
`
})
export class HomeComponent { }
The console gives me this message:
The pipe 'translate' could not be found ("
<h2>[ERROR ->]{{'HOME.TITLE' | translate}}</h2>
"): HomeComponent@1:4 ; Zone: <root> ; Task: Promise.then ; Value: Error: Template parse errors:(…) Error: Template parse errors:
The pipe 'translate' could not be found ("
<h2>[ERROR ->]{{'HOME.TITLE' | translate}}</h2>
"): HomeComponent@1:4
When I try to add a pipes parameter to the Component construction, tsc gives me:
app/home/home.component.ts(9,5): error TS2345: Argument of type '{ selector: string; template: string; pipes: typeof TranslatePipe[]; }' is not assignable to parameter of type 'ComponentMetadataType'.
Object literal may only specify known properties, and 'pipes' does not exist in type 'ComponentMetadataType'.
In trying to track it down, I couldn't find a \@Pipe call, and incorrectly diagnosed the problem. What is the correct diagnosis of the problem?
Expected/desired behavior
Pipe should be found.
Reproduction of the problem
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:btpW3l0jr5beJVjohy1Q).
What is the expected behavior?
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Answered in another issue.
Please mention the issue, in which its solved.
Most helpful comment
Please mention the issue, in which its solved.