Ember CLI allows you to use one of two options to generate a new app:
ember init
(generates application structure and sets up git and makes your first commit)ember new <app name>
(creates a folder with the specified name, steps into it and runs ember init
)Once the generation process is complete, boot a live-reload server within the app folder by running:
ember server
or ember s
for short. *Ta-da, now you have a running Ember app! Official Docs
Creating your first template
Let's create a new template using the ember generate
command.
ember generate template application
The application
template is always on screen when a user is visiting your application. In your editor of choice, open app/templates/application.hbs
and add the following code:
<h2>My first Ember application</h2>
{{outlet}}
Now you should see the newly added text on the welcome page of your application. Also notice that Ember automatically detects the new file and reloads the page for you. Neat, right?