lundi 14 novembre 2016

Ember.js : How to modify data in RESTSerializer

I want to modify the attributes in model.
models/example.js:

export default DS.Model.extend({
  value: DS.attr('number'),

  modified_value: function() {
    /*Some Calculations*/
    return modified_value
  }.property('value'),
})

above code works fine, but it creates another extra attribute in model. So to avoid this,I want to move it to the RESTSerializer. How to do this ?




Aucun commentaire:

Enregistrer un commentaire