【发布时间】:2017-06-10 04:47:27
【问题描述】:
我已经用 angular2 应用程序设置了angular2-google-map。
这里是 app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { AgmCoreModule} from 'angular2-google-maps/core';
@NgModule({
imports: [ BrowserModule, AgmCoreModule.forRoot({apiKey: 'AIzaSyAe3ci9yavJcWt7MaJE8DusAuZo-QeRqkU'}) ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ],
})
export class AppModule { }
我使用命令安装了 angular2-google-maps,
npm install angular2-google-maps --save
已成功安装。当我使用 npm start 运行应用程序时, 它显示一条错误消息,
http://localhost:3000/angular2-google-maps/core加载失败 资源:服务器响应状态为 404(未找到)
但我可以在 node_modules 中看到 angular2-google-maps 文件夹。 什么问题?
【问题讨论】:
-
使用 webpack/System.js 作为模块加载器?
-
在 npm install 的时候,有没有抛出任何警告或异常,你现在至少可以尝试 npm install 然后缓存清理然后重新安装
-
@RahulSingh 不,它不会显示任何错误
-
@PankajParkar 没有使用具有 system.js 的快速启动项目
-
你试过这种方法吗? stackoverflow.com/questions/35970965/…
标签: google-maps angular typescript angular2-google-maps