I am making a flash card app and the business logic is implemented in the backend.
The previous version I use jquery to fetch data and make request between server and client (see below),
getNextCard() {
const {URL, headers} = this._getParams('/next_card');
return Ember.$.ajax(URL, {
method: "GET",
headers
});
},
submitAnswer(card) {
const {URL, headers} = this._getParams('/process_card');
return Ember.$.ajax(URL, {
method: "POST",
headers,
data: card
});
},
I have changed to Ember data in the the current version; however, I am so confusied and do not know what is the proper way to make this kind of request with Ember data.
Should I continue using Ember.$.ajax
to make data process request (like code above) and using Ember data solely for data/model CRUD prupose?
Aucun commentaire:
Enregistrer un commentaire