问题
How do I use angular translator for below condition?
<label class="control-label col-md-3">{{vm.showVat ? Inclusive : Amount}} </label>
回答1:
You can use the translate filter in this way:
{{vm.showVat ? 'Inclusive' : 'Amount' | translate}}"
Where 'Inclusive' and 'Amount' are the keys for the translated values
回答2:
How calling a method that returns you translated text. You can put as much logic as you like in there and it is much easier to test than using angular.element
来源:https://stackoverflow.com/questions/32781875/how-do-i-used-angularjs-translator-conditionally-for-html-label