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

Access attributes of hasMany relationship

$
0
0

@danilovaz wrote:

Hey guys,

I need help...again :smile:

My project have a model Conversation and a model Message. And I configure Conversation with hasMany Messages and Messages belongsTo Conversation.

That's ok, but when I route to url http://localhost:4200/conversations I need to list all conversations and when user click in an specific conversation I load the messages belongs to this conversation.

But when I try to access conversation.messages.content this does not works.

{{#each model as |conversation| }}
   {{conversation.messages.name}}
{{/each}}

I only can access the attributes of model Conversation but can't access attributes of Messages. And when I print {{conversation.messages}} I receive this: subclass of Ember.ArrayProxy.

Anyone can help me understand where I'm be so stupid? :laughing: I search all the documentation and can't understand.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles