lundi 26 septembre 2016

How to pull data from an outside API using EmberJS?

So I'm trying to learn EmberJS, and I'm struggling really hard with this one. Basically, I have the following basic structure

Template:

<ul>
  
    <li> - </li>
  
</ul>

Route File:

export default Ember.Route.extend({
    model() {
        return [
         {'title':'Super Mario Bros', 'console':'NES'},
         {'title':'Pac Man', 'console':'Arcade'},
         {'title':'Galaga', 'console':'Arcade'},
         {'title':'Frogger', 'console':'Arcade'},
         {'title':'Marvel vs. Capcom', 'console':'Arcade'},
         {'title':'The Legend of Zelda', 'console':'NES'},
         {'title':'CastleVania', 'console':'NES'},
         {'title':'Final Fantasy IV', 'console':'SNES'}];
    }
});

But instead of just hardcoding it like I have here, I want to pull it from an Apiary API link using a GET call. How do I do I do this?

(Apiary http://ift.tt/2d4JNaZ)




Aucun commentaire:

Enregistrer un commentaire