Home:ALL Converter>Concatenate string on repeater with Angular Translate

Concatenate string on repeater with Angular Translate

Ask Time:2015-09-08T22:26:26         Author:Aitor

Json Formatter

I want to concatenate a string on a repeater using Angular Translate inside "small" tag to put a description. What i must do?

<li ng-repeat="subtype in type">
    <label>
        <input type="radio" name="radioType" ng-value="subtype" ng-model="dialogModel.type"> 
        {{ subtype.name }} <small>{{ 'subtype.name + "_DESCRIPTION"' | translate }}</small>
    </label>
</li>

Now it shows me a literal string, I don't know how concatenate an Angular Translate string.

Author:Aitor,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/32460364/concatenate-string-on-repeater-with-angular-translate
maow :

If subtype.name + \"_DESCRIPTION is the string you want to translate on, the outter ' is not needed.\n\n{{ subtype.name }} <small>{{ (subtype.name + \"_DESCRIPTION\") | translate }}</small>\n\n\nbtw, if you have many many subtype to repeat, the translate may cause a performance problem , so try to use $filter('translate') in ctrl or simply use one-time binding with \"::\", it seems that you need not to update the _DESCRIPTION again after it rendered in your case.\n\n{{ subtype.name }} <small>{{ ::(subtype.name + \"_DESCRIPTION\") | translate }}</small>\n",
2015-09-08T14:43:29
yy