ngx-translate / core

The internationalization (i18n) library for Angular
MIT License
4.52k stars 578 forks source link

Hi, How I could make ngx translate to rendere html tags inside ts class #1149

Open sjt7911 opened 4 years ago

sjt7911 commented 4 years ago

"userRegisterSuccess": "Registration Successful
Please enter your email and password to start using Software",

this.toastService.success('auth.userRegisterSuccess'))

longgt commented 4 years ago

Use TranslateService.get or TranslateService.instant.

TranslateService.get('auth.userRegisterSuccess').subscribe(msg => this.toastService.success(msg));

or

let msg = TranslateService.instant('auth.userRegisterSuccess');
this.toastService.success(msg);