Search code examples
angularinternationalization

Angular mattooltip with if condition and i18n translation


I try to combine the mattooltip with translation. This works:

[matTooltip]="getValue() == 0 ? 'foo' : 'bar'"

This does not

[matTooltip]="getValue() == 0 ? {{ I18N:foo.bar}} : 'bar'"

How do I get the translation built in at that point?


Solution

  • I solved it with a pipe

    [Mattooltip]="getValue() | pipename | translate"