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?

6
  • using webpack/System.js as module loader? Commented Jan 25, 2017 at 5:48
  • 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 reinstall Commented Jan 25, 2017 at 5:48
  • @RahulSingh no it dint show any error Commented Jan 25, 2017 at 5:49
  • @PankajParkar no am using quickstart project which has system.js Commented Jan 25, 2017 at 5:49
  • did you tried this ways? stackoverflow.com/questions/35970965/… Commented Jan 25, 2017 at 5:49

1 Answer 1

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 .

Sign up to request clarification or add additional context in comments.

4 Comments

now that error is gone, it shows Failed to load resource: the server responded with a status of 404 (Not Found)
Check css file has been present on that path
i have fixed that too, now maps shows empty gray area, any idea?
Not sure, plunkr please

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.