To work with templates, we need to understand the basics on how properties bind with controllers and components. Here are a few recipes that go over how to accomplish this.
Before we get started, we'll need to generate a template.
We'll first create a new application using Ember CLI:
$ ember new HelloWorldApp $ cd HelloWorldApp
This command will generate a new application that we can use for this recipe.
Next, create a new route that will add a new template:
$ ember g route helloworld
This command will generate the template and routes file as well as unit tests. The template file is called
helloworld.hbs
and will be generated in theapp/templates
folder. The route file is calledhelloworld.js
and is located in theapp/routes
folder. Theroute.js
file will also get modified with the newhelloworld
route. We'll discuss more about routes in Chapter 4, Ember Router.After this, we'll need to generate a
controller
:$ ember g controller helloworld
This...