1

I have created an Angular 6 library which uses jquery in it, I have installed Jquery while creating a library and I gave reference of jquery in angular.json in root project where I created Library.

      "styles": [
          "src/styles.css"
       ],
       "scripts": [
           "node_modules/jquery/dist/jquery.js",
       ]

When I consume library in main application it's working.

When I make a library as a pack, then created mylibrary.tgz of my library. Using npm install <location of library tgz file> i install in another application where I need to consume my library.

I am able to access the library but jquery is not found because I did not install jquery in the application that I consume library.

Can anybody tell me how to give dependency of jquery on the library itself when the installed library of jquery also installed automatically in my project?

Usman Maqbool
  • 3,351
  • 10
  • 31
  • 48
Sethuraman
  • 654
  • 6
  • 15
  • you must import jquery library that you added as a module in your code . If you have any problem with importing libraries as a module I will send you a code. – sajadre Jun 25 '19 at 10:47
  • 1
    yea pls can you share me the code – Sethuraman Jun 25 '19 at 11:17
  • Possible duplicate of [What is dependency injection?](https://stackoverflow.com/questions/130794/what-is-dependency-injection) – sajadre Aug 11 '19 at 11:21

0 Answers0