YouAndWeb_TwoToc
f7c47c562dfb62380f9cc00adf29a7ffe5910275
YouAndWeb_TwoToc / client / app / main / main.controller.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
'use strict'; angular.module('dashboardApp') .controller('MainCtrl', function($scope, $http, $state) { $scope.slides = [ { image: 'soccer-ball.jpg', text: 'PARTECIPA, ORGANIZZA, GUARDA, SOCIALIZZA.' }, { image: 'got.jpg', text: 'PARTECIPA, ORGANIZZA, GUARDA, SOCIALIZZA.' } ]; $scope.search = {}; $scope.getLocation = function(val) { return $http.get('//maps.googleapis.com/maps/api/geocode/json', { params: { address: val, sensor: false } }).then(function(response){ return response.data.results.map(function(item){ $scope.search.lat = (item.geometry.viewport.northeast.lat + item.geometry.viewport.southwest.lat) / 2; $scope.search.lng = (item.geometry.viewport.northeast.lng + item.geometry.viewport.southwest.lng) / 2; return item.formatted_address; }); }); }; $scope.searchShow = function() { console.log($scope.search); $state.go('partecipa', {lat: $scope.search.lat, lng: $scope.search.lng}); }; }); |
Commits for YouAndWeb_TwoTocclient/app/main/main.controller.js
Revision | Author | Commited | Message |
---|---|---|---|
f7c47c ... Diff | FSinnona | Mon 30 Nov, 2015 16:24:39 +0000 | Pre Yoeman |
a98e8d ... Diff | FSinnona | Thu 26 Nov, 2015 13:26:45 +0000 | Creazione organizza |
a2ecfb ... | PTKDev | Fri 20 Nov, 2015 11:22:35 +0000 | TwoToc code |