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

implementation of the monthselect plugin in ember flatpicker in ember #583

Closed
asmaaEbed95 opened this issue Nov 18, 2020 · 3 comments · May be fixed by #1556
Closed

implementation of the monthselect plugin in ember flatpicker in ember #583

asmaaEbed95 opened this issue Nov 18, 2020 · 3 comments · May be fixed by #1556
Labels

Comments

@asmaaEbed95
Copy link

asmaaEbed95 commented Nov 18, 2020

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');
@RobbieTheWagner
Copy link
Owner

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

@derrabauke
Copy link

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

@RobbieTheWagner
Copy link
Owner

@derrabauke perhaps we should document this though?

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

Successfully merging a pull request may close this issue.

3 participants