Answer the question
In order to leave comments, you need to log in
How to make Emberjs friends with a third-party api, on a different host?
Good day. Picking ember js, version 2.4. And there adapters have such a parameter as a host, which indicates where to get data for models, etc.
export default DS.RESTAdapter.extend({
host: 'http://localhost:8000/api'
});
Answer the question
In order to leave comments, you need to log in
what is the meaning of the parameter?
(function(){
Ember.Application.initializer({
name: 'load-templates',
initialize: function(container, application) {
application.deferReadiness();
var templates = ['index', 'users'];
Ember.RSVP.all(templates.map(function(item){
return Ember.$.get("PATH_TO_DIRECTORY_WITH/" + item + ".hbs")
})).then(function(all){
all.forEach(function(hbs, i){
Ember.TEMPLATES[templates[i]] = Ember.Handlebars.compile(hbs);
});
}).finally(function(){
application.advanceReadiness();
});
}
});
var App = Ember.Application.create();
})();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question