Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can define a requirejs module that just consists of data: http://requirejs.org/docs/api.html#defsimple. Then in your app incantation (main.js for requirejs stuff), load this module and pass it to your app instance.

If you feel weird about loading data as a js file, there is also a requirejs plugin for loading raw json files as a module: https://github.com/millermedeiros/requirejs-plugins



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: