Model / Store Number in Ember-Data

综合技术 2017-12-31

I'm having some trouble after upgrading to the most recent version of ember-data (1.0 beta 5...I was previously v 14). The error I'm getting is "Error while loading route: TypeError: Cannot set property 'store' of undefined". I'm not setting the store at this point. The error occurs right after the "model" function is called in the route. Any pointers are appreciated.

CallMonitor.ContactPoint = DS.Model.extend({
    "status": DS.attr('string'),
    "contact": DS.belongsTo('contact')
CallMonitor.Contact = DS.Model.extend({
    "type": DS.attr('string'),
    "status": DS.attr('string'),
    "message": DS.attr('string'),
    "creator": DS.attr('string'),
    "spid": DS.attr('string'),
    "added": DS.attr('date'),
    "contactPoints": DS.hasMany('contactPoint')

CallMonitor.ApplicationAdapter = DS.RESTAdapter.extend({namespace: 'api'});

CallMonitor.ContactsRoute = Ember.Route.extend({
    model: function(){
    setupController: function(controller, contacts)
        controller.set('contact', contacts);

It looks like this is a documentation issue with Ember or somesuch. On this page...
you can see that the "hasmany" attribute has a plural key ("comments" like mine, "contactPoints") Apparently, this isn't right anymore. I made this key singular "contactPoint" and it worked fine.

Hello, buddy!

责编内容by:Hello, buddy! (源链)。感谢您的支持!


From Ember to Elixir For the past year or so, I’ve been working on some interesting features in a bunch of different Ember apps at Wombat, but recently I’ve had the opp...
Is it possible to cancel an Ember state transition... TL;DR? I made a jsFiddle here if you want to go to (nearly) working code. Suppose I have an Ember router described below. I'd like to have it ...
Running Ember Fastboot on Your Custom Server Machi... Ember-fastboot is a server-side rendering mechanism for the Ember.js framework. It’s almost ready for release, with some minor bu...
Getting started with Ember.js I played around with Ember.js on and off last year and after building some quickdemos I decided to invest some real time in building real web...
Part 2: Should you use Ember FastBoot or not? TTFB Time To First Byte . If you are unfamiliar with this term, it is simply how long does it take the server to start respondnig back with the fir...