I'm submitting a bug report
[x] bug report => when changing language, subscribers not notified
Current behavior
when subscribe to translate.get() the subscription end automatically . check the next screen shot .
Expected/desired behavior
i need to be still subscribing so when language change the code will rerun a again
Reproduction of the problem
this.translate.get('videoUrl').subscribe(
(videoUrl:any)=>{
console.log('i am a subscriber , changing video url ', videoUrl);
// do this stuff when language change
},
(e)=>{ console.error('i am a subscriber, this is error, ');},
()=>{ console.log('i am a subscriber , i am ended ');}
);

What is the expected behavior?
i need to be still subscribing so when language change the code will rerun a again
What is the motivation / use case for changing the behavior?
it will be awesome, my current situation, i change the video based on language and create some code configuration
Please tell us about your environment:
@angular/cli: 1.4.3
node: 7.7.3
os: win32 x64
ngx-translate version: 7.0.0
Angular version: 4.4.3
Browser: [Chrome Version 61 (Official Build) (64-bit) ]
Same thing. In my case, I'm translating some strings using service instead of a pipe, so I need to automatically change this string if language was changed.
Use .stream() instead of .get()
Thanks a lot @dennisroters It works.
Most helpful comment
Use
.stream()instead of.get()https://github.com/ngx-translate/core#methods