1

I'm trying to use the Clusterize.js library in my Angular project (https://clusterize.js.org/).

I have never imported an external js library in projects, and I am failing trying what I found on the web (add module, place in assets, load in index.html...). Always errors like module Clusterize not found, undefined, or constructor not defined etc...

How to implement Clusterize.js ? What are the best practices ?

Thank you.

0

1 Answer 1

2

Best way to use an external JavaScript library in an Angular project is :

Declare JavaScript file in angular.json

{
  ...
  "scripts": [
    "node_modules/clusterize/clusterize.min.js"
  ]
}

Import it in your TypeScript file as module

import * as Clusterize from 'clusterize';

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.