ember-cli-bootstrap-datepicker
ember-cli-bootstrap-datepicker copied to clipboard
Pass parameter to action?
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.
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
}
}