I have a problem with setting up my controller in angular js.
I want to use angular-google-maps (http://nlaplante.github.io/angular-google-maps/#!/usage)
I have my angular controller like this:
'use strict';
angular.module('myApp', ["google-maps"])
.controller('MainCtrl', [function ($scope) {
}])
.controller('MapCtrl', [function ($scope) {
angular.extend($scope, {
center: {
latitude: 0, // initial map center latitude
longitude: 0, // initial map center longitude
},
markers: [], // an array of markers,
zoom: 8, // the zoom level
});
}]);
But that doesn't work.
This is what i get: Cannot set property 'center' of undefined
What would the right way to setup the controller?