dimanche 26 avril 2015

Ember-data cannot read property 'length' of undefined

I'm trying to get data from api server with ember-data ,i added ember-data to ember starter-kit.

Getting with

App = Ember.Application.create();

App.Router.map(function() {
  // put your routes here
});

App.ApplicationAdapter = DS.RESTAdapter.extend({
    namespace: 'emberjs/ember.js',
    host     : 'http://ift.tt/1xWFuAe'
});

App.Store = DS.Store.extend({
    adapter: 'App.ApplicationAdapter'
});

App.IndexRoute = Ember.Route.extend({
  model: function() {
    return this.store.find('pull');
  }
});

App.Pull = DS.Model.extend({
    url : DS.attr(),
    title  : DS.attr(),
    body  : DS.attr()
});

Giving the same error for every request. then i try with github, it gives the same error.

Api that i connected: Github api

Error while processing route: index Cannot read property 'length' of undefined TypeError: Cannot read property 'length' of undefined




Aucun commentaire:

Enregistrer un commentaire