ember-flatpickr icon indicating copy to clipboard operation
ember-flatpickr copied to clipboard

Add documentation about how to use plugins

Open Gorzas opened this issue 6 years ago • 3 comments

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 avatar Oct 10 '19 13:10 Gorzas

@Gorzas I think that is fine, but I think the idea is you can pass any options flatpickr supports.

RobbieTheWagner avatar Oct 10 '19 14:10 RobbieTheWagner

@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 avatar Jun 04 '20 23:06 gzurbach

@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.

RobbieTheWagner avatar Jun 05 '20 14:06 RobbieTheWagner