I'm using an if/else expression and a translation of the possible values inside the placeholder-Tag of an HTML input-element. It obviously doesn't work this way, because of the nested double quotes inside the placeholder-tag:
<input type="number"
placeholder="{{constraint ? '{{"TERM_A" | translate}}' : '{{"TERM_B" | translate}}'}}"
ng-model=""
required
autocapitalize="none"
autocorrect="off" />
How do I set the single/double-quotes accordingly or is there even a more elegant solution?
Proper way:
<input type="number"
placeholder="{{ (constraint ? 'TERM_A' : 'TERM_B') | translate }}"
ng-model=""
required
autocapitalize="none"
autocorrect="off" />
Another sample:
label="{{ (detailsTriggered ? 'ui.showDetails' : 'ui.hideDetails') | translate}}"
Beware of " [ ] " braces, types of quotation marks and apostrophes.