2017-10-19 7 views
-2

나는이 개 모듈을 사용구글 모듈 충돌

ERROR in C:/.../ng-cli/src/app/app.component.ts (25,21): Namespace 'google' has no exported member 'visualization'. 
ERROR in C:/.../ng-cli/src/app/app.component.ts (52,12): Property 'charts' does not exist on type 'typeof google'. 
ERROR in C:/.../ng-cli/src/app/app.component.ts (145,30): Property 'visualization' does not exist on type 'typeof google'. 

Google지도 네임 스페이스에서는 google.maps를 선언

"@types/google.visualization": "0.0.40", 
"@types/googlemaps": "^3.29.1", 

이 같은 충돌이 만듭니다.

google.visualization은 네임 스페이스 Google 및 내부 차트 및 시각화를 선언합니다.

올바르게 해결하려면 어떻게해야합니까?

+0

'app.component.ts'의 25 번째 줄에는 무엇이 있습니까? – Henry

+0

변수 선언입니다. chartData : google.visualization.DataTable; –

답변

0

그래서 저는 google.visualization 모듈을 제거하여 문제를 해결했습니다. index.d.ts의 모든 선언은 src 디렉토리의 새 파일로 이동되었으며이 새 파일은 "src/google-visualization.ts"와 같은 섹션의 tsconfig.json 섹션에 설명되어 있습니다. 이제는 훌륭한 작품입니다.