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

Bug related to angular-cli if using moment in your app #1

Closed
maxailloud opened this issue Nov 15, 2016 · 4 comments
Closed

Bug related to angular-cli if using moment in your app #1

maxailloud opened this issue Nov 15, 2016 · 4 comments

Comments

@maxailloud
Copy link

FYI there is currently a bug in angular-cli and webpack (or maybe just one of them) preventing to use your module if we use momentjs in our app at the same time. Look at it here.

I mean we can use it, but in my case I have the case because of some other datepicker used in my app (I have some shared code between my apps).

@superstarmcawesome
Copy link
Owner

hey there. I will check on the weekend. Which other datepicker you're using? I have also the ng2-bootstrap with its datepicker running. but I'm using the angular 2 seed by mgechev.. and there without any problems.

@maxailloud
Copy link
Author

I'm using the datepicker from ng2-bootstrap too.
I'm using angular-cli generated project, it seems the issue is with webpack loading momentjs.

I have an issue with momentjs with one of my package that uses momentjs too.

@superstarmcawesome
Copy link
Owner

sounds that the problem is with cli and not ng2-bootstrap or the daterangepicker itself. cause i can easily import moment...

@maxailloud
Copy link
Author

To use your directive I needed to add momentjs, jquery and bootstrap in the list of scripts in the angular-cli.json file.
By doing so I can't use momentjs in my app anymore using import * as moment from 'moment; because it is empty, need to use declare var moment: any;.
But that's not ideal, and yes it's an issue with angular-cli.

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

2 participants