0

I have two scope variables in my controller.

$scope.list = {title: 'Lorem Ipsum'}

$scope.data = {'Lorem Ipsum' : {'keys': 'values'}}

In my view I want to access :

<div>{{data['list.title'].keys}}</div>

This is kind of requirement, I dont want {{data['Lorem Ipsum']}} which actually works but there are some dynamic binding that i need to do. Any help?

2 Answers 2

3

Remove the single quotes from your array index:

<div>{{data[list.title].keys}}</div>
Sign up to request clarification or add additional context in comments.

2 Comments

Getting empty object like {{}}
I've just tested this with your example data, and the text "values" shows up in the div for me as expected... Is what you've provided, exactly the same data you're using?
1

Do just:

<div>{{data[list.title].keys}}</div>

2 Comments

Getting empty object like {{}}
I know what exactly it is, Thanks buddy

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.