0

I have a [$parse:syntax] error with this code :

<img class="trs_img" id="{{ 'TRS_EN' | translate, 'active' : menu == 'lord'}}" ng-click="changeLanguage('en');" />
  • first : translation id translated with angular-translate,
  • second: id active if it's check the value 'lord' in menu scope

what is the good syntax?

1
  • 1
    @RajavelD I don't know how that suggestion passed, but that list has no place in a code block. Commented Aug 19, 2014 at 11:09

2 Answers 2

1

Remove the double curly braces:

<img class="trs_img" id="{'TRS_EN' | translate, 'active' : menu == 'lord'}" ng-click="changeLanguage('en')" />
Sign up to request clarification or add additional context in comments.

Comments

1

You cannot have two IDs in one element - if you want something like this try use ng-class.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.