2016-10-05 3 views
2

angular2에서 일부 모듈을 가져오고 오류가 있습니다. 흔적을 찾을 수 없습니다. 예 angular2 - 구글 -지도 system.config.jsangular2 traceur not found

var map = { 
... 
'angular2-google-maps/core': 'node_modules/angular2-google-maps/src/core', 
... 
}; 
var packages = { 
    'angular2-google-maps/core': { 
    main: 'core-module.ts', // or index.ts 
    defaultExtension: 'ts' 
    }, 
    ... 
}; 

응용 프로그램/app.module.ts

import { AgmCoreModule } from 'angular2-google-maps/core'; 

오류 : http://localhost:3000/traceur 404

을 찾을 수없는 방법 올바른 방법으로 설정 모듈에서 angular2?

답변

1

demo plunker에서 알 수 있듯이 제대로 작동하려면 umd 파일을 가져와야합니다. 브라우저에서 typescript을 원하지 않으므로 TS 파일을 가져 오는 것은 효과가 없습니다. Javascript 개가 필요합니다.

var map = { 
... 
'angular2-google-maps/core': 'node_modules/angular2-google-maps/core/core.umd.js', 
... 
}; 
var packages = { 
    ... //NOT CHANGED 
}; 
+0

if core.umd.js. 어떻게 그것을 생성합니까? –

+0

polygon과 함께 angle2-goggle-map [link] https://github.com/SebastianM/angular2-google-maps/tree/ee34fc0c82fe88be07d53b03008ab0e8ec385723을 다운로드하고 core.umd.js [/ link]가 없습니다. 이 Google지도를 가져 오는 방법. Mybe는이 모듈을 컴파일할까요? –

+0

이상한 점은 npm을 사용하지 않는 이유는 무엇입니까? – Supamiu