allenhwkim / angularjs-google-maps

The Simplest AngularJS Google Maps V3 Directive
http://ngmap.github.io
MIT License
1.52k stars 516 forks source link

NgMap is not defined #796

Open grzesiekmq opened 7 years ago

grzesiekmq commented 7 years ago

I get

Uncaught ReferenceError: NgMap is not defined

when I try

 var nm = NgMap.getMap();
        var svc = new google.maps.places.PlacesService(nm);
w0ns88 commented 7 years ago

show more code plz... did you inject NgMap in your controller, what about in app.js? then we can help more :)

ghost commented 7 years ago

Check if correctly injected NgMap in module, in controller, and with correct order.

amolswnz commented 7 years ago

I had the same issued, but it is fixed.

My app.js file angular.module("myApp", ['ngRoute', 'ngMap']).

My city.ctrl.js file


angular.module('myApp')
  .controller('MyCtrl', ['$scope', 'MyCities', 'NgMap', function($scope, MyCities, NgMap) {