Wednesday, June 7, 2017

ember.js practice

-install ember-cli
npm install -g ember-cli

- create project
ember new hello-world

--start server
ember server

- create controller
ember g controller application

- create route
ember g route about
ember g route parent
ember g route parent/child

--create component
ember g component x-counter

-- script on page
{{#unless showName}}
 <h2 id="title">Hello {{name}}</h2>
{{else}}
 <h2 id="title">Hello Ember</h2>
{{/unless}}

<button {{action 'toggleName'}}>Toggle Name</button>

<br/>

{{numClicks}} Click

<button {{action 'incrementClicks'}}>Increment</button>

No comments:

Post a Comment