dimanche 6 septembre 2015

Ember Data 2.0 findAll dont work

I have a problem, I wrote a little code to access the data band through a servlet, I am trying to use the ember date to make REST calls, however I am having problems using the store.findAll only to find works normal with the findAll returns the following error:

Assertion Failed: You must use Ember.set() to set the content property (of ) to ``.

follows some information that can be useful:


Model name: veiculo
Servlet path(GET): api/veiculos

below is the code only the javascript because the html and just to show the same result.

Adapter:

//Setup RESTApi
App.ApplicationAdapter = DS.JSONAPIAdapter.extend({
    host        : 'http://localhost:8080/app-test',
    namespace   : 'api',
});

Model:

// Veiculos model
App.Veiculo = DS.Model.extend({
    placa               : DS.attr( 'string' ),
    marca               : DS.attr( 'string' ),
    modelo              : DS.attr( 'string' ),
    ano                 : DS.attr( 'number' ),
    cor                 : DS.attr( 'string' ),
    cpfproprietario_fk  : DS.attr( 'string' ),
});

App.VeiculoSerializer = DS.RESTSerializer.extend({
    primaryKey: 'placa'
});

the strange thing is that no servlet and called with the findAll, but to find work normal this hard to find updated material Ember Data, already tried using RESTAdapter, and tried to use the App.Store also and also did not work.

Sorry english is google trans.




Aucun commentaire:

Enregistrer un commentaire