Many Html pages in an Ember Application


#1

Hello,

  Till now I met some Ember examples which use only index.html page , where we can have many templates. 

  So I am wondering if it is possible to have more than one html page.  If Ember will detecte then automatically to search
  for templates or we need to declare them  ?

Thank you.

Maxim


#2

Yes, it is possible to store all your templates as separate files in some folder.

You can precompile templates automatically in one file using grunt-ember-templates Grunt plugin. In combination with grunt-contrib-watch you can make it update templates automatically as soon as you edit them.

For more advanced users (in my opinion), there is generator-ember Yeoman generator that does handles complete application build process including templates, minification and style compiling.


#3

Thank you I will see that.


#4

Is it possible to do it without Grunt? I tried Grunt based process once and it made everything very slow.


#5

There is ember-precompile command line utility, but I haven’t used it recently, so I am now sure if it still works well.

You can also give a try to ember-cli (github), but is not just for templates, it will set up whole ember environment, similar to Yeloman’s generator-ember, but without Grunt.


#6

A good alternative to using grunt for your build process is broccoli. It boasts super fast compile times (often less than a second), and already has quite a few plugins to handle the more common tasks like concatenation, minifying, CSS preprocessing and template precompilation. While it’s still in beta, it’s definitely worth checking out.


#7

Well, in this case we should mention another popular Grunt alternative: Gulp :slight_smile: