0

I have json file with key:value, for example "TRANS_NAME": "Some name". In controller:

$scope.translate = TranslateData.get().data; //gets that json with key : value

In template/html

<div ng-repeat="contact in contacts">
 <label class="col-sm-3 control-label">{{contacts.keyTranslationName}}</label>
</div>

I need to get contacts.keyTranslationName from $scope.translate as a key, is it possible to do something like this:

{{ translate.{{contacts.keyTranslationName}} }}

1
  • {{translate[contacts.keyTranslationName]}} Commented Dec 22, 2014 at 10:28

2 Answers 2

2

this may helps you

{{ translate[contacts.keyTranslationName] }}
Sign up to request clarification or add additional context in comments.

1 Comment

glad to help you :) cheerz
0
{{translate[contacts.keyTranslationName]}}

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.