In this lesson, we'll go over some of the basics of Ember.js templates and how they work with controllers.git
Generate a controller:github
ember g controller hello
Generate a Template:app
ember g template application
Template syntax:less
application.hbs:this
{{#if showName}} <h2>Hello {{name}}</h2> {{else if}} <h2>Hello World</h2> {{/if}} {{#unless showAge}} <h2>Hello {{name}}, 23</h2> {{else if}} <h2>Hello Ember!</h2> {{/unless}}
application.js:spa
import Ember from 'ember'; export default Ember.Controller.extend({ name: "Ember", showName: true, showAge: false });
Githubcode