简体   繁体   English

无法识别灰烬物体

[英]Ember object not being recognized

in my project I'm using ember and it's not recognizing an object that I've created. 在我的项目中,我使用的是余烬,它无法识别我创建的对象。 I created the object called 我创建了一个名为

App.RouteSearch = App.ModuleObject.extend({ ... });

and when I go to create a new instance of that object I use 当我去创建该对象的新实例时

App.RouteSearch.create({"Config": null});

but all this does is error out and tell me "Uncaught TypeError: Cannot call method 'create' of undefined." 但是所有这一切都是错误的,并告诉我“ Uncaught TypeError:无法调用未定义的方法'create'。” Has anyone come across this before or have any idea what I could do to fix it? 有没有人遇到过这个问题,或者有任何想法我可以解决这个问题? Thank you for any help. 感谢您的任何帮助。

App.ModuleObject.extend() never returns undefined. App.ModuleObject.extend()永远不会返回未定义。 At least if you have a App.ModuleObject that extends some Ember.Object subclass. 至少如果您有一个App.ModuleObject扩展了一些Ember.Object子类。 I think that your script ordering is wrong. 我认为您的脚本顺序是错误的。 You are importing: 您正在导入:

App.RouteSearch.create({"Config": null});

before then: 在那之前:

App.RouteSearch = App.ModuleObject.extend({ ... });

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

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