3 angular.module('dashboardApp')
4 .controller('MainCtrl', function($scope, $http, $state) {
8 image: 'soccer-ball.jpg',
9 text: 'PARTECIPA, ORGANIZZA, GUARDA, SOCIALIZZA.'
13 text: 'PARTECIPA, ORGANIZZA, GUARDA, SOCIALIZZA.'
18 $scope.getLocation = function(val) {
19 return $http.get('//maps.googleapis.com/maps/api/geocode/json', {
24 }).then(function(response){
25 return response.data.results.map(function(item){
26 $scope.search.lat = (item.geometry.viewport.northeast.lat + item.geometry.viewport.southwest.lat) / 2;
27 $scope.search.lng = (item.geometry.viewport.northeast.lng + item.geometry.viewport.southwest.lng) / 2;
28 return item.formatted_address;
33 $scope.searchShow = function() {
34 console.log($scope.search);
35 $state.go('partecipa', {lat: $scope.search.lat, lng: $scope.search.lng});