I have a need to request some data from a third party API endpoint in an Ember app (Using Ember 1.7)
I'm not sure the best way to handle the response, should I:
-
Use
$.ajaxin my model hook, return the raw data and not worry about Ember models? -
Use
$.ajaxin my model hook, usestore.createRecordto map the returned data into models and usestore.allto return this data to my component. -
Use an adapter and use
store.findAllto get the data (could be tricky as the returned data won't match my models).
I'm not quite sure of the pros and con's of getting data in this way, any input would be great.
Aucun commentaire:
Enregistrer un commentaire