I'm getting oriented to the structure of an ember.js application, and I think I understand the purpose of the routes, controllers, models, templates and helpers.
The thing that I don't understand is where I would put a complex function. Suppose I have an action called computeSuggestions
, that lives in a controller. It may happen that this one action is very big and complicated, and would be easier to test if it were in its own module, where it could be defined as a pure function.
What would be the typical way to handle this? I'm not very experienced with JavaScript import statements, but I know enough to know that they aren't as easy as in Java or Python. I'm also unsure where in the directory structure would be the normal place for such a function.
Based on the docs at http://www.ember-cli.com/#using-modules, it seems like the best place for something like this would be in the /app/utils folder.