Import Javascript libraries in Angular

Updated:

In this example we show how to import a JS library in your Angular project generated by the CLI.

Add the library to your project

Include the JS file in your path, e.g.: src/assets/js.

Modify angular-cli.json

Add the library to your angular-cli.json, e.g:

  "scripts": [ 
        "../node_modules/jquery/dist/jquery.min.js", 
        "../src/assets/css/hl/highlight.pack.js", 
        "../src/assets/js/autotrack.js" 
      ], 

WebApp built by Marco using SpringBoot 3.2.4 and Java 21, in a Server in Switzerland without 'Cloud'.