Skip to content

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

Closed

Description

@matt-erhart

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.

Activity

  1. matt-erhart commented on Sep 20, 2016

    @matt-erhart
    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')
    
  2. serhiisol commented on Sep 21, 2016

    @serhiisol
    Contributor

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

  3. JanStureNielsen commented on Sep 21, 2016

    @JanStureNielsen

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

  4. filipesilva commented on Oct 3, 2016

    @filipesilva
    Contributor

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

  5. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  6. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions