4

I have setup the angular2-google-map with angular2 application.

And here is the 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 { }

And i installed the angular2-google-maps with the command,

npm install angular2-google-maps --save

which got successfully installed. when i run the application with npm start, it shows an error saying,

http://localhost:3000/angular2-google-maps/core Failed to load resource: the server responded with a status of 404 (Not Found)

but i can see the angular2-google-maps folder inside the node_modules. what is the issue?

hirse
  • 2,394
  • 1
  • 22
  • 24
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396

1 Answers1

5

You forgotten to add map for in system.config.js

'angular2-google-maps/core': 'npm:angular2-google-maps/core/core.umd.js'

By adding above to systemjs configuration. Module loader will understand to load core.umd.js when you tries to import angular2-google-maps/core .

Pankaj Parkar
  • 134,766
  • 23
  • 234
  • 299