I was wondering how to read adapter properties on a router?
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
host: document.getElementById("rootUrl").value,
namespace: "api"
});
In some cases we are not using the DS.Store but have to return JSON from an api. I’d like to be able to use the adapter properties to help generate the getJson
model: function () {
var url = store.host + store.namespace + 'somedata;'
return Ember.$.getJSON(url).done(function (tree) {
var x = tree;
console.log("success loading org tree api data :-)");
return tree;
}).fail(function (jqXHR, textStatus, errorThrown) {
alert(textStatus + ' due to: ' + errorThrown);
});
}
I musty be over thinking this but so I have to create an instance of the store somehow in order top read these properties? I suppose I could create properties of my own but I want to do this correctly.
Thank out there… Ember Forever!