【发布时间】:2019-03-07 02:00:30
【问题描述】:
我正在尝试从主网站:https://angular-maps.com/guides/getting-started/ 实例化一个 angular-google-maps 示例,以对应用程序进行一些测试。
我使用他们的示例代码如下:
import { Component } from '@angular/core';
@Component({
selector: 'page-location',
templateUrl: 'location.html',
})
export class LocationPage {
title: string = 'My first AGM project';
lat: number = 51.678418;
lng: number = 7.809007;
}
page-location
{
agm-map {
height: 150px;
}
}
<h1>{{ title }}</h1>
<!-- this creates a google map on the page with the given lat/lng from -->
<!-- the component as the initial center of the map: -->
<agm-map style="height: 300px;" [latitude]="lat" [longitude]="lng">
<agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map>
最后抛出如下错误:
core.js:1449 ERROR 错误:未捕获(承诺中):TypeError: Object(...) is not a function TypeError: Object(...) is not a function 在新的 FitBoundsService (fit-bounds.js:31) 在 createClass (core.js:12481) 在 _createProviderInstance (core.js:12458) 在 createProviderInstance (core.js:12299) 在 createViewNodes (core.js:13771) 在 callViewAction (core.js:14218) 在 execComponentViewsAction (core.js:14127) 在 createViewNodes (core.js:13812) 在 createRootView (core.js:13673) 在 callWithDebugContext (core.js:15098) 在新的 FitBoundsService (fit-bounds.js:31) 在 createClass (core.js:12481) 在 _createProviderInstance (core.js:12458) 在 createProviderInstance (core.js:12299) 在 createViewNodes (core.js:13771) 在 callViewAction (core.js:14218) 在 execComponentViewsAction (core.js:14127) 在 createViewNodes (core.js:13812) 在 createRootView (core.js:13673) 在 callWithDebugContext (core.js:15098) 在 c (polyfills.js:3) 在 Object.reject (polyfills.js:3) 在 OverlayPortal.NavControllerBase._fireError (nav-controller-base.js:223) 在 OverlayPortal.NavControllerBase._failed (nav-controller-base.js:216) 在 nav-controller-base.js:263 在 t.invoke (polyfills.js:3) 在 Object.onInvoke (core.js:4760) 在 t.invoke (polyfills.js:3) 在 r.run (polyfills.js:3) 在 polyfills.js:3
感谢您帮助我们寻找问题的根源。
【问题讨论】:
-
如果你是 ionic 的初学者,可以关注这篇文章 URL:joshmorony.com/…
标签: android angular ionic2 ionic3