JohnDel
JohnDel

Reputation: 2102

Ember-cli and app structure

I am playing with ember-ci and trying to figure out where I should put the files. Most tutorials that I have found, put them in one file and it just works.

This is my application. My problem is that the templates/application.hbs doesn't render the views/index.html and the views/about/html which according to what I've read, it should render it on the outlet of the application template.

Should I put these files somewhere else?

Upvotes: 1

Views: 300

Answers (1)

blessanm86
blessanm86

Reputation: 31779

I just went through your application. Here are a couple of mistakes I noticed.

  1. You are putting html files in the views folder. The template files should be put inside the templates folder with the extension hbs.

  2. In you templates, you are specifying 'data-template-name'. But that is not necessary. Just put whatever html you want to display in that hbs file. The name of this file is the relevant part. Ember-cli uses a custom resolver. It resolves controllers, templates, view... etc based on the name of the file. You may want to go the project site to see the naming conventions. Its a bit different than the naming conventions in ember site.

Okay now here are the steps I did to get you site working.

  1. Moved the files index.html and about.html from the views folder to the templates folder. I changed the extension of both these files to.hbs`.

  2. Removed the script tags inside the 2 templates mentioned above.

Upvotes: 2

Related Questions