en_btr_frontend/app/initializers/load-book-data.js

14 lines
369 B
JavaScript

export function initialize(appInstance) {
// application.inject('route', 'foo', 'service:foo');
let metaTag = document.querySelector('meta[name=book-data]');
if (metaTag) {
let store = appInstance.lookup('service:store');
let bookContent = JSON.parse(unescape(metaTag.content));
store.pushPayload(bookContent);
}
}
export default {
initialize
};