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

Is there an event when update parts of a model from backend?

$
0
0

@Myrdhin wrote:

We have the following model:

// app/models/user.js
import Ember from 'ember';
import DS from 'ember-data';

export default DS.model.extend({
  login    : DS.attr('string'),
  language : DS.attr('string'),
  homepage : DS.attr('string'),
  firstname: DS.attr('string'),
  lastname : DS.attr('string')
})

We have a login route where a user is loaded (with a this.get('store').queryRecord('user', ...)) from the backend. Only login, language and homepage attributes are loaded. So we have a user instance with these attributes defined in the store and other are undefined.

Another route display a user list where this previous user is displayed too. We use this.get('store').query('user', queryparams) to load this list. Only firstname and lastname of each user are loaded so the previous user instance (loaded in login route) is updated in the store.

We need to to know when this update occurs : is there an event about this? Thanks for your help,

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4830

Trending Articles