Conditional translated text inside button?



I have a button than contains “Continue” or “Save” text conditionally:

Is this the correct way to get this or there are a better way?

Important: Text must be translated using ng2-translate.

Thanks in advance.


i would try ternary operator:

  {{ canGoBack ? ('Save'|translate) : ('Content'|translate) }}

i think a div inside of a button is invalid html :wink:


Thank you @bengtler.

It works!