example
example copied to clipboard
Using TranslateService in component
Since the function to get translated value returns an observable. So could we have some examples that show how to use TranslateService with best practices in a component? For an example, I want to show a message when executing an action successfully.
I think we can do likes this
alert(await this.translate.get('newThing.message').toPromise());
Does anyone have better approaches?