Combustion007
Combustion007

Reputation: 474

Setting up EmberJS project directory structure?

I have been working with EmberJS online guides, and it has been somewhat of a hit or miss process. With Sproutcore2 I could generate the project directory structure via commandline command and be done with it. Well with Ember, it is rather manual. I would like to be able to set up a project's director structure where I am able to separate the model(s),view(s), and control(s) into their own folders. I have been trying to do so but require statements aren't importing correctly from MVC folders. I have downloaded the "todos" app, but it is no help, because the directory structure is not demonstrated as I had expected.

I would like to start with a simple "HelloWorld" application where "app" will be my facade, and I can then import my models,views, and controls from their folders which will be placed under mvc folder within the "HelloWorldApp" folder. Appreciate all your help.

HelloWorldApp (project directory)
   ->js (directory)
   ->lib (directory)
            ->ember-0.9.5
            ->ember-0.9.5.min
            ->jquery-1.6.1.min

  ->template (directory)
          ->main-view-template

  ->mvc (directory)
      ->model (directory)
      ->view (directory)
      ->control (directory)

  ->css (directory)

app (app.js)
index.htm

Upvotes: 12

Views: 3720

Answers (2)

Combustion007
Combustion007

Reputation: 474

After trying out different approaches, I ended up declaring all my model(s), views(s), and controller(s) in the index file right after where the ember-0.9.5 is being called via javascript. Once I did that I was able to instantiate my model "Person" in "app".

Thx.

Upvotes: -3

Roy Daniels
Roy Daniels

Reputation: 6309

Take a look at the early alpha of the Ember build tools' template structure (based on Ember-Skeleton): https://github.com/emberjs/ember-gem/tree/master/lib/ember/templates/app. I'd imagine that something very close to this structure will be the default moving forward.

Upvotes: 8

Related Questions