【发布时间】:2016-05-29 16:23:51
【问题描述】:
有谁知道如何将谷歌地图添加到 Angular 2 应用程序中?
我目前在我的 index.html 页面中链接到它,如下所示:
<script src="node_modules/angular2-google-maps/bundles/angular2-google-maps.js"></script>
但是在我的 Angular 2 组件中使用它时出现此控制台错误:
system.src.js:1061 GET http://localhost:3000/angular2-google-maps/core 404(未找到)
这是我的控制台的屏幕截图:
系统配置:
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
},
'angular2-google-maps': { defaultExtension: 'js' }
}
});
System.import('app/boot')
.then(null, console.error.bind(console));
【问题讨论】:
-
你配置systemjs了吗?
-
是的,我在下面添加了我当前的步骤
标签: angular angular-google-maps