lundi 29 juin 2015

Ember 1.13 - DS.attr deprecation

I've upgraded to Ember v1.13.0, and now I have a couple of deprecation warnings (as expected) but I can't find any clue as to how to get rid of them. Ember has provided some links to the guides but they are useless and disappointing.

The most common deprecation I have is for the DS.attr('type') method on Ember.Model.

How does the new syntax work? Please provide an example by converting this model into the new format

import DS from 'ember-data';

var Order = DS.Model.extend({
  price: DS.attr('number'),
  date: DS.attr('string'),
  shopName: DS.attr('string'),
  shippingStatus: DS.attr('string'),
  destination: DS.attr('string'),
  dueFor: DS.attr('string')
});

export default Order;




Aucun commentaire:

Enregistrer un commentaire