ember-flatpickr
ember-flatpickr copied to clipboard
implementation of the monthselect plugin in ember flatpicker in ember
i tried to implement the plugin inside my project as i can not implement it in the hbs file and it cannot pass it's parameters to the js file in the .hbs file the code as follows:
<EmberFlatpickr
@plugins=plugins />
in the .js file:
import Controller from '@ember/controller';
import monthSelect from 'flatpickr/dist/plugins/monthSelect /index';
export default Controller.extend({
plugins: [new monthSelect ()],
});
in ember-cli-build.js file:
app.import('node_modules/flatpickr/dist/plugins/monthSelect /index.js');
@asmaaEbed95 we may need to add plugins here https://github.com/shipshapecode/ember-flatpickr/blob/master/addon/components/ember-flatpickr.js#L114 I've never used plugins, and I don't really know.
It think this issue can be closed.
The approach works nowadays.
<EmberFlatpickr
@date={{this.date}}
@onChange{{on "change" (pick "target.value" this.handler))}}
@plugins={{array this.monthSelect}}
/>
all the arugments to EmberFlatpickr are collected via ...rest and passed to the constructor. :+1:
@derrabauke perhaps we should document this though?