vendredi 25 octobre 2019

Updating from bubble action(sendAction()) to closure action

I'm trying to update my code to the latest version of ember and I want to avoid deprecations. I have read that using closure actions is more preferred over bubble actions. So I am currently updating my code to make it more usable.

Following is the code:

app/components/date-picker.js

actions: {
    onChange() {
      if (this.onChange) {
        this.sendAction('onChange');
      }
    }
  }

app/templates/components/date-picker.hbs


  <i class="calendar icon"></i>


Can anyone describe to me on how to update it so that I could use closure actions. Additional references to this would be helpful. Thanks




Aucun commentaire:

Enregistrer un commentaire