ember-flatpickr
ember-flatpickr copied to clipboard
Add documentation about how to use plugins
I'm currently working with ember-flatpickr and using the week select plugin. As I tested, you currently can use plugins with this library but I think it should be documented.
We could use the plugin the following way:
{{ember-flatpickr
plugins=plugins
}}
And having the controller like this:
import Controller from '@ember/controller';
import weekSelect from 'flatpickr/dist/plugins/weekSelect/weekSelect';
export default Controller.extend({
plugins: [new weekSelect()],
});
What do you think?
@Gorzas I think that is fine, but I think the idea is you can pass any options flatpickr supports.
@Gorzas for some reason your solution did not work for me...
I had to add this line to my ember-cli-build.js file:
app.import('node_modules/flatpickr/dist/plugins/rangePlugin.js');
I'm using Ember 3.4 with ember-auto-import installed 🤷♂️
@gzurbach probably because we don't import any plugins in the addon https://github.com/shipshapecode/ember-flatpickr/blob/master/index.js#L16
I haven't tried using plugins myself, so I am not sure how to better support this.