abuiles / ember-cli-101-errata

18 stars 4 forks source link

Request at page 84 not resolving #226

Closed FanaHOVA closed 9 years ago

FanaHOVA commented 9 years ago

At page 84 we're given this code:

import Ember from 'ember';
import request from 'ic-ajax';
export default Ember.Route.extend({
    model: function() {
        return request('/api/friends').then(function(data) {
            return {
                friendsCount: data.friends.length
            };
        });
    }
});

But the request inside the model function won't resolve. We're also using api/v2 at this point of the book. I've specified the host on adapters/application.js but nothing; using

return request('http://api.ember-cli-101.com/api/v2/friends').then(function(data) 

fixed it though, in case somebody has the same error.

abuiles commented 9 years ago

@FanaHOVA thanks! probably there was something weird with your setup? I just tried this out and it works fine. can you try again?