I am new at Angular, and I am not able to install the Leaflet library, with the same calls to the library that I use in HTML I do not work at angular, I wanted to know if someone knows how to install it. Thanks and regards.
I am new at Angular, and I am not able to install the Leaflet library, with the same calls to the library that I use in HTML I do not work at angular, I wanted to know if someone knows how to install it. Thanks and regards.
You can install the package using:
npm install leaflet --save
When the package is installed, you should be able to enter the path for the style and script files found in node_modules, going to angular-cli.json
in the sections: "styles": []
and "scripts": []
Remember that Angular uses Angular-CLI - More information here
If you want to import the package into an existing module
At the top of your module write:
import L from 'leaflet';