Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation about how to use plugins #352

Open
Gorzas opened this issue Oct 10, 2019 · 3 comments
Open

Add documentation about how to use plugins #352

Gorzas opened this issue Oct 10, 2019 · 3 comments

Comments

@Gorzas
Copy link

Gorzas commented Oct 10, 2019

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?

@RobbieTheWagner
Copy link
Owner

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

@gzurbach
Copy link

gzurbach commented Jun 4, 2020

@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 🤷‍♂️

@RobbieTheWagner
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants