mercredi 21 janvier 2015

How to write ember.js components work require.js

No code involved yet, so morning to show. I am trying to get into it.


I am writing an ember.js application, using require.js as AMD. I am trying to wrote an ember component, and having a hard time deciding what goes where.


The templates are in their own directory and loaded by need using text.js (in the 'define' statement of require), and compiled in the ember view.


As far as I understand, the components need to be in /components directory, which I have done. But what from there? At what route/view/controller do I load them, and how do I compile them? I tried just loading and compiling in the view, but that have me an error, complaining about env not being there. I tried extending Ember.Component and compiling there, but I he l got the same error.


Did someone ever implement components using require.js? Can you me a skeleton of how it looks like?





Aucun commentaire:

Enregistrer un commentaire