Skip to content

Importing 3rd party libs with/without type definitions [doc request] #2257

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

Closed
matt-erhart opened this issue Sep 20, 2016 · 5 comments · Fixed by #2487
Closed

Importing 3rd party libs with/without type definitions [doc request] #2257

matt-erhart opened this issue Sep 20, 2016 · 5 comments · Fixed by #2487

Comments

@matt-erhart
Copy link

matt-erhart commented Sep 20, 2016

What's the angular-cli (webpack) way to import a js lib without any type definitions?

For the doc request, can we get many more (and detailed) 3rd party examples in the docs? One of the biggest advantages of js is all the code out there. I think it would save people a lot of trouble if they had a lot of examples and explanations to guide them. I had this worked out with systemjs, but I ran into different issues for different libs. It would be great if someone who really understands angular-cli/webpack could try and use a wide variety of js libs (old/new, popular/obscure, with/without definitions) and just document what they did to get it to work--from download/install, config edits, type definition edits, hacks, all the way to the actual import statement (with location) they used. Would be especially great to have the logic of these steps explained.

@matt-erhart
Copy link
Author

To answer my first question,

npm install jslib --save 
//don't add anything to angular-cli.json
//then, in the file you want to use the jslib add:
var jslib = require('jslib')

@serhiisol
Copy link
Contributor

It's not the case, you should provide definitions for typescript directly, but not to CLI.

@JanStureNielsen
Copy link

@matt-erhart - the issue tracker is for project bugs and project feature requests as noted in CONTRIBUTING.md. For better support, consider creating a question on StackOverflow with all the details.

@filipesilva
Copy link
Contributor

Heya, I added some documentation about this on #2487.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants