AbdulFattah Popoola
AbdulFattah Popoola

Reputation: 947

How to structure Ember Web Application

I am developing my first application using Ember and would love to know the best way to structure my application.

Presently I have only a single page containing all the various portions of my page.Is there any way to split up the index page and asynchronously load content from elsewhere? I'll prefer this as my index page is growing too long.

Upvotes: 0

Views: 207

Answers (1)

Toran Billups
Toran Billups

Reputation: 27399

I would ask how complex your application will be

If you can start small with a single file containing your views/controllers/router it helps you grok the framework for the first few days/weeks. If you find your single js file grows > 100+ lines (or whatever number makes you feel like it's time to break it up) you could create a folder for

/templates => handlebars templates here (pre compiled if possible)
/views => just the view javascript objects
/controllers => array controllers or object controllers
/models => ember-data or regular JS objects that do the heavy lifting
/routers => in the future you may have > 1 router per ember.js app

Once you reach this level of complexity you might take a look at require.js to manage your dependencies / etc

Upvotes: 1

Related Questions