How to create templates in different files in ember1.10?

I am using ember 1.10. If i run my ember app it only takes templates which are wrote inside the index.html it doesn’t take templates which are created in another file.

How can i solve it?

Thank in advance.

Note: I want to create ember app without ember-cli

This is significantly too little information for us to be able to answer the question. :smiling_imp:

This is not something that is supported at all.

Since you are not using ember-cli, the answer to your actual question is 100% dependent on whatever you are using to build / bundle your application. That build tool would need to be updated to look for .hbs files throughout the codebase and compile them (using the template compiler that ships with your version of Ember) and ensure they end up in the proper resolvable location.

I admire your bravery of :wink:

  1. using Ember 1.10
  2. Not using Ember-cli

I started off not using ember-cli because I was not aware of what it was. It definitely works without ember-cli as long as all the files were in the right place. I don’t recommend it though!

I have the following includes:

 	<script type="text/javascript" src="/app/webroot/js/ember/ember-template-compiler.js"></script>
<script type="text/javascript" src="/app/webroot/js/ember/handlebars-v3.0.1.js"></script>
<script type="text/javascript" src="/app/webroot/js/ember/ember.js"></script>
<script type="text/javascript" src="/app/webroot/js/ember/emberdata.min.js"></script>
<script type="text/javascript" src="/app/webroot/js/ember/application.js"></script>

Thank you :slight_smile:

let check, i understand your code correctly, ember-template-compiler.js is helps to compile our templates which are in different files and gives them back if we request the template.

I am right?

I honestly could not say ! I just thought I’d give you what I included in case it helps.

When you say different files do you mean different routes, or do you mean components ?

I mean, components and templates.

for routes,i directly include the route.js files. but, for components it doesn’t work.

The thing is, this is the reason why the ember-cli is useful.

One of the issues I had when I first started out without it was never really knowing why it doesn’t work when it doesn’t. It could be anything, you might have left a bracket off somewhere - that could be enough to break it,

Ember-ckli has a load of tools included that will point out that sort of problem (most of the time), and tell you if you have put a file in the wrong place…etc

What is your reason to want to use such an old version, and your reason for not using ember-cli? I suspect you’ll have more hassle getting that to work than you would upgrading