简体   繁体   中英

Why is my Ember.Router giving this TypeError?

I'm using Ember built from git master. My RouteManager is not complex, but when I try to start my app, I get this error:

Uncaught TypeError: Property '1' of object , is not a function

Following the trace indicates that this is happening on the app's initialization.

This jsfiddle shows the problem, although you'll have to look in the javascript console to see the error message. My actual router will be more complex than this, but I've pared it down to the bones to try to eliminate potential error sources.

随着注入API的更改,您需要将您的Ember Data版本更新为master的最新版本。

Here is a fiddle which "works".

http://fiddle.jshell.net/Sly7/ZySzK/

I pick up an ember-data resource from another fiddle I found on stackoverflow.

The way of populating the arraycontroller is weird. Usually you pass the context in the connectOutlet method of the controller, by specifying a context (in your case, it should be Sylvius.Section.find() ) I don't know why, but doing this, I have the error 'Sylvius.Section has no method find'... perhaps an other mess due to ember-data/emberjs bad version.

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