简体   繁体   English

无法从ember-data扩展DS.Model

[英]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: Firebug给了我2个错误:

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

removeObject = Ember.EnumerableUtils.removeObject;

And this for Extending the DS.Model 这用于扩展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.* 使用相同的模型扩展Ember.Object可以正常工作,我只是不能使用DS。*

Google had 0 results for those error messages Google对这些错误消息的结果为0

The most likely cause of this is a bad combination of ember-data and ember libs. 最可能的原因是ember-data和ember libs的糟糕组合。 About 4 weeks ago Ember.ArrayUtils was renamed to Ember.EnumerableUtils . 大约4周前, Ember.ArrayUtils被重命名为Ember.EnumerableUtils I assume you are using a pretty recent version of ember-data but an older version of ember.js. 我假设您使用的是最新版本的ember-data,而不是旧版本的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. 你可以将ember升级到最新版本,如果你喜欢使用边缘,或者只是在ember-data中进行查找和替换,你可能会遇到其他的一致性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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