vendredi 12 avril 2019

Ember invoking closure action

In Ember JS, say I have a component defined as below (HBS/JS)

//parent.hbs


// app/components/longclaw-sword.js
export default Ember.Component.extend({
  click() {
    this.attack();
  }
});

Is there any difference between calling the closure action using this.attack() V/s this.attr.attack() ?

In which cases is "attr" used ? Can it be used for reference to normal properties OR is it only for actions ?




Aucun commentaire:

Enregistrer un commentaire