Components are used to encapsulate (repetitious) markup and tie it to behavior. Instead of separating our concerns along technological lines (HTML, CSS, JS), components tie all three of these technologies together under a reified visual element in the user interface.
By the end of this, developers should be able to:
- Model the user interface using components
- Represent visual hierarchies with nested components
- Register actions and click handlers on component objects
- Pass data from routes to components, and from components to components
- Fork and clone this repository.
- Install dependencies with
npm install
andbower install
.
From Communication Between Distant Components - Ember Igniter
Let's wireframe the Listr client application interface with a focus on identifying different logical interface elements. We'll call these visual elements "components".
Let's name it listr-list
to follow best practices. We wouldn't want to clash
with any new HTML elements in future specs!
Name it listr-list/item
.
Toggle display of list on header click.
Toggle strike-through of list item on item click.
- Ember Component Guide
- Ember Component API Documentation
- Ember Actions
- Ember Action Handler
- Parent to Children Component Communication for UI State - Ember Igniter
- Communication Between Distant Components - Ember Igniter
- Ember Best Practices: Actions Down, Data Up... wait what?
- How Ember Data affects data down, actions up
Source code distributed under the MIT license. Text and other assets copyright General Assembly, Inc., all rights reserved.