Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4826

Add model data from cotroller

$
0
0

@light44 wrote:

hello , I am trying to implement skeleton loading in the ember app. This requires me to move the data loading from route to controller. Now the challenge is to load the model ‘heros’ from controller.

controller.js

fetchData(queryParams) { const res = fetch(https://someurl?heroes=${*queryParams*.heros})

.then(res=> res.json())
.then(res=>{
 console.log(res);
/*{heroes:[{hero1:xx},{hero2:xx},{hero3:xx}]*/
/* from here i want to load the res to a model name hero*/

});

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles