Skip to content

Using TranslateService in component #2

Description

@stormit-vn

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions