YouAndWeb_TwoToc
a2ecfb85282bb782ae96a40499c728d5c266f710
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: 'DAJE, SU, MEH, AHO' } ]; $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 |
---|---|---|---|
a2ecfb ... | PTKDev | Fri 20 Nov, 2015 11:22:35 +0000 | TwoToc code |