question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to setup to test translate pipe in template?

See original GitHub issue

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

Please help!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:13

github_iconTop GitHub Comments

5reactions
ocombecommented, Feb 16, 2017
let injector = getTestBed();
let translate = injector.get(TranslateService);
translate.use('en');
0reactions
phatpham9commented, Feb 16, 2017

@ocombe thank you so much I did it. Close the topic now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing Pipes – Testing Angular
Create an instance of the Pipe class manually. Then call the transform method. This way is fast and straight-forward. It requires minimal setup....
Read more >
angular - Unable to test component that uses translation pipe ...
in your testBed config add in imports the TranslateModule like you do in your appModule or the module where the component is declared....
Read more >
Creating Translate Pipe - The Angular Book
Creating Translate Pipe. The pipe we have generated at the beginning of this chapter needs to inject the translation service instance in the...
Read more >
Testing Pipes - Angular
If you'd like to experiment with the application that this guide describes, run it in your browserrun it in your browser or download...
Read more >
Test Angular Pipes With Services - Level Up Coding
translationService.translate(lang); } }. Which by the way can be use with the help of the async pipe in a template (in following example, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found