简体   繁体   中英

Ember.js Object #<Object> has no method 'resolve' (jsFiddle inside)

I have code ( http://jsfiddle.net/bug0r/94h3a/17/ )

There is error when data loading by rest.api - Object #<Object> has no method 'resolve'

Could you help to find an error?

ember - https://raw.github.com/emberjs/ember.js/release-builds/ember-1.0.0-rc.3.js


var A = window.App = Ember.Application.create({
    VERSION: '1.0',
    rootElement: '#appRoot',
    LOG_TRANSITIONS: true
});
A.deferReadiness(); // do not initialize it until we are ready

A.Adapter = DS.RESTAdapter.extend({
    namespace: 'api',
    url: 'http://bug0r.apiary.io'
});
A.Adapter.map('Semantic', {
    primaryKey: 'Key'
});
A.Store = DS.Store.extend({
    revision: 12,
    adapter: A.Adapter
});

A.Router.map(function () {
    // each call will create Ember.Route instance for customizing route
    this.resource("semantic", {
        path: "/"
    });
    this.route("about", {
        path: "/about"
    });
    this.route("favorites", {
        path: "/favs"
    });
});

A.SemanticRoute = Ember.Route.extend({
    model: function () {
        return A.Semantic.find();
    }
});

/* Symantic model*/
A.Semantic = DS.Model.extend({
    Key: DS.attr('string'),
    Name: DS.attr('string'),
});

A.advanceReadiness(); // ready for initialization

In the fiddle, you are using ember-rc3 combined with ember-data latest. I think they are not compatible. So try to use ember-latest too, it should work.

EDIT: the latest ember build is http://builds.emberjs.com.s3.amazonaws.com/ember-latest.js the latest ember-data build is http://builds.emberjs.com.s3.amazonaws.com/ember-data-latest.js

BE CAREFULL These builds are the last succesfull builds, passing all of the tests, but there no warranty they are bug-free.

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