简体   繁体   中英

Unable to extend DS.Model from ember-data

This is my model

App.Person = DS.Model.extend({
    first_name: null,
    last_name: null,
    gender: null,
    profession: null,
    age: null
});

And Firebug gives me 2 errors:

TypeError: Ember.EnumerableUtils is undefined
[Break On This Error]   

removeObject = Ember.EnumerableUtils.removeObject;

And this for Extending the DS.Model

TypeError: DS.Model is undefined
[Break On This Error]   

App.Person2 = DS.Model.extend({

Extending Ember.Object works fine with the same Model, i just can not use DS.*

Google had 0 results for those error messages

The most likely cause of this is a bad combination of ember-data and ember libs. About 4 weeks ago Ember.ArrayUtils was renamed to Ember.EnumerableUtils . I assume you are using a pretty recent version of ember-data but an older version of ember.js. You can either upgrade ember to the latest if you are happy working with the edge or simply do a find and replace in ember-data, you may run into other consistencies though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM