byCoder
byCoder

Reputation: 9184

AngularJS translate & ui tooltip html

I have such view:

uib-tooltip-html="tooltipData(form, field)"

and tooltipData returns data (example):

***
var str = $translate.instant('LONG_EMAIL')
return str;
***

and when i switch lang of my app - translation isn't updating((

when i hardcode (it's a bad way of solving this issue)

uib-tooltip-html="{{'LONG_EMAIL' | translate}}"

all is fine

How can i translate my string returned from the controller?

Upvotes: 2

Views: 5072

Answers (2)

An easier solution

uib-tooltip="{{ 'LONG_EMAIL' | translate }}"

Upvotes: 1

Pankaj Parkar
Pankaj Parkar

Reputation: 136174

You could achieve this by having $filter over translate

var str = $filter('translate')('LONG_EMAIL')
return str;

Upvotes: 0

Related Questions