February 2016
Beginner to intermediate
308 pages
5h 46m
English
Components can communicate changes with actions. These actions can be sent back to the parent or be handled in the component. Let's take a look at a few recipes that show this.
In this recipe, we'll create a student list that we will then manipulate.
student-list component:
$ ember g component student-list
This will generate the student-list component and the necessary files.
student-list.js file in the app/components folder. We'll need to create a few actions and a new array:// app/components/student-list.js import Ember from 'ember'; export default Ember.Component.extend({ init() { this._super(...arguments); this.setup(); }, actions: { remove(){ this.get('listOfStudents').popObject(); ...Read now
Unlock full access