Saj*_*ran 4 google-maps typescript angular2-google-maps angular
我已经设置了angular2-google-mapangular2应用程序.
这是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 { }
Run Code Online (Sandbox Code Playgroud)
我用命令安装了angular2-google-maps,
npm install angular2-google-maps --save
Run Code Online (Sandbox Code Playgroud)
哪个成功安装.当我用npm start运行应用程序时,它显示错误说,
http:// localhost:3000/angular2-google-maps/core无法加载资源:服务器响应状态为404(未找到)
但我可以在node_modules中看到angular2-google-maps文件夹.问题是什么?
你忘了加入map了system.config.js
'angular2-google-maps/core': 'npm:angular2-google-maps/core/core.umd.js'
Run Code Online (Sandbox Code Playgroud)
通过将以上内容添加到systemjs配置中.core.umd.js尝试导入时,模块加载器将理解加载angular2-google-maps/core.
| 归档时间: |
|
| 查看次数: |
1079 次 |
| 最近记录: |