Reputation: 254
This is my scenario.
First I tried a modal as component. After I see this is incorrect, then I moved to ember-data and do this on the route. I create a ember-data for location list (which be a component) and other for register values. I create the adapter and a serializer. So I completely lost what do next. How I do this, using a ember-data to search places(a GET) and a registration(POST) on the API?
Upvotes: 0
Views: 177
Reputation: 3207
if you have to make multiple requests at the same time you do
Ember.RSVP.all([
$.ajax(...),
this.store.findAll('person'),
...
]).then(function([result1, result2, result3 ]){
console.log('all requests finished');
})
if you want sequential request (one after another) you simply chain them
$.ajax(...).then((ajaxResult) => {
return this.store.findAll('person')
}).then((person)=>{
....
}).then(function(){
console.log('all requests finished')
})
Upvotes: 1