ember-cli-bootstrap-datepicker icon indicating copy to clipboard operation
ember-cli-bootstrap-datepicker copied to clipboard

Pass parameter to action?

Open IntellectProductions opened this issue 8 years ago • 1 comments

Is there anyway to pass a parameter to the action hooks on this component?

Right now, I have this:

{{bootstrap-datepicker value=model.purchase_date format='mm/dd/yyyy' name='purchase_date' class='form-control' id='purchase_date' changeDate='calculateNextAppt'}}

But I need to be able to pass a parameter to this action method.. is there a way to do so in this component?

Thank you.

IntellectProductions avatar Apr 11 '16 12:04 IntellectProductions

You could try using the action helper like this:

{{bootstrap-datepicker changeDate=(action 'calculateNextAppt' 'parameter')}}

Then the action function would be like this:

actions: {
  calculateNextAppt(date, parameter) {
    // do sth with the new date
  }
}

NicholasJohn16 avatar Apr 14 '16 03:04 NicholasJohn16