Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate-one as angular expression #15

Open
studentIvan opened this issue Apr 22, 2016 · 1 comment
Open

Translate-one as angular expression #15

studentIvan opened this issue Apr 22, 2016 · 1 comment

Comments

@studentIvan
Copy link

For example i want to optimize this case:

<span translate-once="BUYER" ng-if="deal.getMyRole() == 'BUYER'"></span>
<span translate-once="SELLER" ng-if="deal.getMyRole() == 'SELLER'"></span>

Why I can't use it like below?

<span translate-once="deal.getMyRole()"></span>
@atticoos
Copy link
Owner

atticoos commented Apr 22, 2016

translate-once receives values as attribute strings, so expressions will not work unless they're part of an interpolation string.

Give this a try with

<span translate-once="{{deal.getMyRole()}}"></span>

The big hint is that normal strings work, translate-once="BUYER", but expressions don't. That usually implies it's not interpretted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants