I am trying to use Google maps in my angular 4 app.
I am using Angular 4 and Nodejs 8.
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ApplicationRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './appponent';
import { AgmCoreModule } from '@agm/core';
@NgModule({
imports: [
BrowserModule,
CommonModule,
FormsModule,
AgmCoreModule.forRoot({
apiKey: 'GOOGLEAPIKEY'
})
],
providers: [],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule {}
Please help me ??
I am trying to use Google maps in my angular 4 app.
I am using Angular 4 and Nodejs 8.
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ApplicationRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { AgmCoreModule } from '@agm/core';
@NgModule({
imports: [
BrowserModule,
CommonModule,
FormsModule,
AgmCoreModule.forRoot({
apiKey: 'GOOGLEAPIKEY'
})
],
providers: [],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule {}
Please help me ??
Share Improve this question edited Nov 14, 2018 at 4:28 Vishal Biradar asked Jul 13, 2017 at 13:12 Vishal BiradarVishal Biradar 1,2292 gold badges12 silver badges25 bronze badges3 Answers
Reset to default 16npm install @agm/core --save
This command solved my problem.Thanks a lot.
Had the same issue.. Just run :
npm uninstall @agm/core -s
npm install @agm/core -s
It cannot find the module because you forgot to add it in your NgModule in imports :P :
imports: [
BrowserModule
AgmCoreModule.forRoot({
apiKey: 'GOOGLEAPIKEY'
})
],
Best regards ;)