You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
component.ts file declare var Datamap: any; # outside the component, to say the typescript it is defined somewhere in the app
and then put my code in a lifecycle hook like that:
ngAfterContentInit(): void {
var map = new Datamap({
element: document.getElementById('test-container'),
fills: {
defaultFill: 'rgba(23,48,210,0.9)' // Any hex, color name or rgb/rgba value
}
});
// var colors = d3.scale.category10();
}
but unfortunately, It did not load anything. I am getting an error in the console that: datamap is undefined.
Can someone please help me to fix that problem?
The text was updated successfully, but these errors were encountered:
I also faced this problem after angular ^12 update. Seems like npm i datamaps that package is not compatible with the recent changes on angular. So i did a work around.
copy the necessary files in assets folder and add in angular.json "scripts": [ "node_modules/jquery/dist/jquery.min.js", "src/assets/lib/datamaps/d3.min.js", "src/assets/lib/datamaps/topojson.js", "src/assets/lib/datamaps/datamaps.world.lores.js" ],
in your component or service where ever you are using it
After installed with
npm i datamaps
I have modified my angular.json file like that:angular component I was using like that:
component.ts file
declare var Datamap: any;
# outside the component, to say the typescript it is defined somewhere in the appand then put my code in a lifecycle hook like that:
but unfortunately, It did not load anything. I am getting an error in the console that:
datamap
is undefined.Can someone please help me to fix that problem?
The text was updated successfully, but these errors were encountered: