''agm-map' is not a known element:

I try to show a google map in angular 12 I installed agm/core and imported it but it still has error with the agm-map tag.

here is my code: HTML:

<agm-map [latitude]="lat" [longitude]="lng">
  <agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map>

TS:

  lat = 51.678418;
  lng = 7.809007;

APP.MODULE.TS:

import { AgmCoreModule } from '@agm/core';
@NgModule({ 
   imports[
          AgmCoreModule.forRoot({
      apiKey: 'my api key'
    })
]})

Please help me, I can't understand what's the problem with that. Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source