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

How to import correctly vis.min.js map files into angular2 with angular-cli.json scripts brackets & Timeline is not displayed until I add new event into the timeline #42

Open
lostation opened this issue Nov 1, 2017 · 2 comments

Comments

@lostation
Copy link

Hi Seveves,

First big Thanks for your wrapping work !
I'm beginner in angular2 world and sometimes some errors makes me disappointed.

1 - How to import correctly vis.min.js map files into angular2

I use angular-cli.json file to configure app.
Then after npm install vis --save
Then to load all the "vis" stuffs ( and explicitly not use the import from the head index.html )

Like this :

"styles": [
"../node_modules/vis/dist/vis.min.css"
],
"scripts": [
"../node_modules/vis/dist/vis.min.js",
"../node_modules/vis/dist/vis.js",
"../node_modules/vis/dist/vis.map"
],

On reload the app with "ng serve" ... it always tells me that there's a parsing error in the vis.map file.
Do you know the purpose of this file ? and why there's a parsing error ?
If I skip it the browser reclaims it and then tell me a http 404.
So I also tried to import vis.map emptied but nothing better.

Do you have an idea ?

2 - Timeline is not displayed until I add new event into the timeline

Globally it works but not on first loading. I need to add a new event to get the timeline rendered.
It's maybe more an angular2 error than something related to timeline...
But again if you have an idea to get directly the timeline component rendered...could be great.

Thanks for your help.

@lostation
Copy link
Author

lostation commented Nov 1, 2017

Ok it seems that add the json options makes the rendering works... So question 2 is closed.

@seveves
Copy link
Owner

seveves commented Mar 6, 2018

Hi ... at the moment I can not give full support on this project because I ran out of time. I'm sorry for that.

But what I did is adding the vis.js and vis.css files directly to my index.html. The angular-cli config is normally the right choice but it loads the scripts with the help of webpack and I'm not sure if the vis files are fully compatible with webpack (in their raw, bundled format).

Maybe you can give this a try :)

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