In both static sites and applications served by rails I’ve just placed jquery code in a separate js file for standard interactivity. For example, a function that sizes a container div to the exact size of the browser, or clicking a link and a drop down pops out instead of linking to another page – pretty standard stuff.
Where should I put these functions in my ember app?
I think it really depends on what the “plain javascripts” are doing. If they’re manipulating the DOM for view/control reasons (IE jQuery plugins) they should be wrapped with a component. And that component should be included in a template. 2.0 Components have a range of hooks for different lifecycle events, but didInsertElement is generally appropriate for DOM updates.
If the plain javascripts are more data bound (IE Analytics, Realtime) you can, but don’t have to, wrap them in a service. Then if there is any initialization you can do it in your ApplicationRoute’s setupController hook.
It’s been a year since your last post, if you can tell me a bit more your use case I might be able to help you better.