ES6構文を使用して(webpack経由でjson-loaderを使用して)ロードするJSONオブジェクト(agendaItemsJson)があります。以下を使用すると、fetch が URL を解析しようとしていて、agendaItemsJson がオブジェクトであるため、エラーが発生します。
したがって、私の質問は、これを正しく模倣して、promise を使用し、agendaItemsJson を応答として取得できるようにするにはどうすればよいかということです。
'use strict';
import BaseService from './base-service';
import agendaItemsJson from '../json/agenda.json';
class _AgendaService extends BaseService {
getAgenda() {
// TODO: Will use API instead of the JSON here under.
return this.fetch(agendaItemsJson)
.then(response => response);
}
...