mardi 16 août 2016

Setting the host for an adapter using a variable fails

When trying to set the host for an adapter, it won't work if the string is in a variable:

var url = 'http://localhost:4000';
export default DS.JSONAPIAdapter.extend({
  host: url
});

But this will work:

export default DS.JSONAPIAdapter.extend({
  host: 'http://localhost:4000'
});

I am actually trying to import a setting from config/environment.js, but I simplified the issue. I just wanted to know why this is happening.




Aucun commentaire:

Enregistrer un commentaire