Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4838

How do I access an array that is inside a model - in a controller

$
0
0

@gjhawar wrote:

If I have a JSOn which has an array element like :slight_smile:

model.person = {"name" : "a",
"schools" : [
{"id" : 1,
"city" : "SF" },
{ "id" : 2,
"city" : "NYC}
]
}

And my templates has :slight_smile:
{{#each model.person.schools as |person_school|}}

The question is If I want to access this person_school.city value of the model in the controller for this array traversal how would I do that since,

this.get('person_school') won`t work

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4838

Trending Articles