ember-ajax
ember-ajax copied to clipboard
allow host and namespace be empty
Allow host and namespace be empty strings?
// app/services/ajax.js
export default AjaxService.extend({
host: 'https://my-awesome-app.com',
namespace: '/api/v1',
});
// Some controller/component action
this.ajax.request('/some-url', { namespace: '/' });
// Expected: GET 'https://my-awesome-app.com/api/v1/some-url'
// Result: GET 'https://my-awesome-app.com/api/v1/some-url'
this.ajax.request('/some-url', { namespace: '' });
// Expected: GET 'https://my-awesome-app.com/some-url'
// Result: GET 'https://my-awesome-app.com/api/v1/some-url'
Is there any reason for not using Ember.isNone check?