Skip to content

Instantly share code, notes, and snippets.

@mwilc0x
Last active December 30, 2015 10:39
Show Gist options
  • Save mwilc0x/7817585 to your computer and use it in GitHub Desktop.
Save mwilc0x/7817585 to your computer and use it in GitHub Desktop.
I successfully receive data in mapsRequest object, however when I go to
app.controller('MapCtrl', ['$scope', '$rootScope', function ($scope, $rootScope) {
$scope.lat = 40.722283;
$scope.lng = -74.005623;
$scope.mapOptions = {
center: new google.maps.LatLng($scope.lat, $scope.lng),
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
$rootScope.$on('mapsRequested', function (evt, mapsRequest) {
$scope.lat = mapsRequest.lat;
$scope.lng = mapsRequest.lng;
});
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment