EmberJS helper to invoke methods on a given context such as components or controllers.
ember install ember-invoke
// component/restaurant.js
import Component from '@ember/component';
export default Component.extend({
people: [{
first: 'Bob',
last: 'Smith',
age: 43
}, {
first: 'Jen',
last: 'Doe',
age: 19
}, {
first: 'Bill',
last: 'Foobar'
age: 74
}],
canDrink(age) {
return age >= 21;
}
})