Open rafalp opened 9 years ago
I've created dict on request object that contains preloaded data. My middlewares and views may add keys on this dict, which is on render turned into json and assigned to window.PreloadedData = {{data|json}}
:
https://github.com/rafalp/Misago/blob/master/misago/templates/misago/preloaded_data.js
In Ember.js I have custom "PreloadStore" utility class that lets me reach to this data, and from there I may use it wherever I want:
https://github.com/rafalp/Misago/blob/master/misago/emberapp/app/utils/preloadstore.js
However, this is only basic solution for a problem, and it will need changes to eventually support serialized models that I could push to Ember-data (vide authenticated user or current ACL).
@rafalp Thanks a lot!
@rafalp Any resources? Would be exactly what I need. =)