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

hasMany not updated only when changing the route

$
0
0

@Henry wrote:

Hi guys, I have a strange problem. Let's say that I have two models post and comment. post has a hasMany relationship with comment. In the route posts/:id I can list all the comments correctly or apply to them pushObject / removeObject to add or remove comments but there's a particular case in which this doesn't work:

  1. If I remove one comment using removeObject (I keep that record in a service)
  2. then transit to posts
  3. then transit back to posts/:id
  4. and push the same comment with pushObject

The template doesn't update with the old record and, if I repeat the step 2 and 3 again, the old comment appears again.

What could be the reason why the hasMany relationship doesn't update in that particular case?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles