4
votes

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?

1
using webpack/System.js as module loader?Pankaj Parkar
at the time of npm install, did it throw any warnings or exceptions, the least you can try now is npm install and then cache clean and then reinstallRahul Singh
@RahulSingh no it dint show any errorSajeetharan
@PankajParkar no am using quickstart project which has system.jsSajeetharan

1 Answers

5
votes

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 .