I want to translate messages in my angular2 material snackbars. Problem is to show snackbar I need to pass message as parameter. To translate using i18n: https://angular.io/api/common/I18nSelectPipe . I can't use interpolation as parameter. So how I can transform my message in snackbar?
<button md-button (click)="openSnackBar(message, action)">Show snack-bar</button>
You can use it explicity by calling tranform
method on new instance of pipe:
import { I18nSelectPipe } from '@angular/common';
const msg = new I18nSelectPipe().transform(message, this.inviteMap);