February 2016
Beginner to intermediate
308 pages
5h 46m
English
Most frameworks include some sort of binding implementation. Ember is no exception and has bindings that can be used with any object. The following recipes explain how to use them as well as one-way and two-way binding.
In this example, there is a teacher and student Ember object. Each has its own set of properties and they both have homeroom. We can share the homeroom by setting an alias for the teacher object.
Ember.Object:const Teacher = Ember.Object.extend({
homeroom: '',
age: '',
gradeTeaching: ''
});
const Student = Ember.Object.extend({
homeroom: Ember.computed.alias('teacher.homeroom'),
age: '',
grade: '',
teacher: null
});The student homeroom is Ember.computed.alias ...
Read now
Unlock full access