0

I am using Angular 2 Toaster in my application and also NGX-translate. I would like to achieve a Toaster with Translated items. It should be like below.

translate.setTranslation('en', {
    INVALID_CREDENTIALS: 'Invalid Credentials'
});
this.translate.get('INVALID_CREDENTIALS').subscribe((res: string) => {
    this.toasterService.pop(this.createToast("success", "Success",res));
});

Here I would like to get the popup with success with Invalid Credentials, but unfortunately it displays

INVALID_CREDENTIALS

  • You have a `translate` and a `this.translate`, and you have a trailing ` in your code. Please make sure you've included the exact code your running. – Daniel B Dec 13 '19 at 07:57
  • The above code inside the constructor and the below one is on ngOninit(). POP up or Toaster is displaying but I need this value "Invalid Credentials" but am I getting INVALID_CREDENTIALS – user1349544 Dec 13 '19 at 08:00

0 Answers0