vendredi 30 septembre 2016

Getting data from a REST API into ember.js application?

I followed the ember.js quickstart instructions to get a basic app up and running. I've been trying to figure out how to adjust this code in one of the route files to pull data from a REST API rather than defining it explicitly in an array.

   export default Ember.Route.extend({
      model() {
        return ['Ada Lovelace', 'Niklaus Wirth', 'Bill Gates', 'James Gosling', 'Guido van Rossum', 'Ken Thompson', 'Donald Knuth']
      }
   });

Except instead of writing in these names, I'd like to get data from a mock REST API URL. Can anyone tell me how to do this or direct me to an article that describes how? Some details about underlying concepts would also be greatly appreciated. Thanks!




Aucun commentaire:

Enregistrer un commentaire