Problem with TranslateService in Pipe
See original GitHub issueI’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 I’m creating a new pipe that uses translate service inside. Code below:
export class TimeRemainingPipe implements PipeTransform {
constructor(private translateService: TranslateService) {}
transform(input: any, args?: any): any {
return this.translateService.get('TEST').subscribe(res => res);
}
}
When I use that pipe in the template, what I got is always [object]
string. I think the problem is observable/subscriber
but I don’t know how to solve it.
Please help! Thank you very much.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
ERROR in : The pipe 'translate' could not be found
I can see that the TranslateService works fine as it properly translate and output to the console successfully, however the pipe nor the...
Read more >How to unit test a component with TranslateService ... - GitHub
Question How to test a component that uses TranslateService and the translate pipe? I have a root module with: TranslateModule.
Read more >How to translate your Angular app with ngx-translate
1. Add ngx-translate to your Angular application 2. Set up the TranslateService in your app.module.ts 3. Create your main language translation file (in...
Read more >How To Use ngx-translate with Angular - DigitalOcean
Using TranslateService. Using the service, there are two methods to get your translations. The first, and recommended, method is to use:.
Read more >Translate your Angular App with Pipes - malcoded
Translating you app to other languages is a pretty common task. Unfortunately it can be a very frustrating and boring topic.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
problem solved. the code is below
any thanks @NKjoep 😃
Sorry @NKjoep I didn’t see your edit in the previous comment. I just tried and the output still the same.