-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to import datamaps in angular app #537
Comments
I also faced this problem after angular ^12 update. Seems like copy the necessary files in assets folder and add in angular.json in your component or service where ever you are using it declare var d3:any; on top and you are good to go |
I use this https://www.npmjs.com/package/angular-datamaps to use datamaps within Angular. Maybe that helps? |
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: