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?
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')
})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.