Angular-google-maps: 'agm-map' is not a known element

Created on 29 Dec 2018  ·  3Comments  ·  Source: SebastianM/angular-google-maps

Hi All

i am a student learning angular and ionic
i am using angular cli 6.2.4 and ionic 4.2.1
I would like to make use of Angular Google Maps (AGM)

In the app.module.ts i have imported after running npm install @agm/core --save
import { AgmCoreModule } from '@agm/core';

in the @NgModule imports array i have added AgmCoreModule.forRoot({apiKey: 'API KEY HERE'})

When trying to add to one of my component pages created with the ionic cli i get the following error:
'agm-map' is not a known element:

  1. If 'agm-map' is an Angular component, then verify that it is part of this module.
  2. If 'agm-map' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

the funny thing is that if i go to app.html i am able to successfully add the tag with no errors

any ideas what could be causing this issue

Most helpful comment

@n1t3w0lf are the other pages you created in their own modules? If so, you will need to import the AgmModule there as well.

All 3 comments

@n1t3w0lf are the other pages you created in their own modules? If so, you will need to import the AgmModule there as well.

@hebra
Each new page i created does have an module.ts file after adding the imports here it seems to be working

Thank you very much for your feedback

@n1t3w0lf you're welcome. Please close the issue as it is not an issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matishw picture matishw  ·  3Comments

vamsibassetty08 picture vamsibassetty08  ·  3Comments

ChrisDevinePimss picture ChrisDevinePimss  ·  3Comments

PeterSisovsky picture PeterSisovsky  ·  3Comments

muhammad-shahzad-anjum picture muhammad-shahzad-anjum  ·  4Comments