What does 'export default' do in ember?


#1

After some googling, I understand ‘export default’ is some new syntax in ES6, but what does it exactly do in the ember world? It’s being used extensively in ember.


#2

You might want to have a look at http://jsmodules.io/ :wink:


#3

Should I understand it as the following: each .js file (no matter it’s a controller or a route) in ember should contain a primary function?


#4

For the most part, for things like routes, controllers, etc. although it’s probably easier to consider them as objects. But often utilities will export more than one “thing”. You might think of the export/import paradigm as making things “pluggable” while maintaining a separation of concerns.