Exercise
Yesterday we looked at a few methods in the computed namespace in Ember. Today let's put s few of those (any maybe a few others) to use. This will be easiest to complete using Ember Twiddle .
Step 1
Given this component:
export default Ember.Component.extend({
name: 'David Ross',
position: 'Catcher'
});`
add a computed property that returns
name
and
position
in an array:
=> ['David Ross', 'Catcher']
Step 2
You have a property on a controller that is an array of values, create a computed property that returns true if the "property is null, an empty string, empty array, or empty function."
Step 3
Given this array:
['Jim', 'Josh', 'Brandon', 'Sarah', 'Jack', 'Kristen',
'Adam']
, create an input in the template, and a computed property in the
controller that filters those values by the value of the input.
Hint: The first two are one liners.
Comments for Exercise and Links