Is it possible to pass a function to an Ember.js component to execute it as an action callback?

Viewed 1217

I'm wondering if it's possible to pass a function as a parameter of an Ember component

// component.hbs
{{component fun=fun}}

and then, from an action in the component, calling this same function :

// component.js
actions: {
  fun2() {
     let fun = this.get('fun');
     fun();
  }
}
1 Answers
Related