Skip to content

Instantly share code, notes, and snippets.

@MARIAEL
Created January 25, 2016 15:22
Show Gist options
  • Save MARIAEL/1cfe0059d55286c5cd28 to your computer and use it in GitHub Desktop.
Save MARIAEL/1cfe0059d55286c5cd28 to your computer and use it in GitHub Desktop.
proyecto zapatones
'use strict';
/**
* @ngdoc function
* @name zapatonesApp.controller:AboutCtrl
* @description
* # AboutCtrl
* Controller of the zapatonesApp
*/
angular.module('zapatonesApp')
.controller('EmpresaCtrl', function ($scope, $http) {
$scope.meteo = function(){
$http.get('http://api.openweathermap.org/data/2.5/weather?q='+$scope.ciudad+','+$scope.zona+'&units=metric&appid=2de143494c0b295cca9337e1e96b00e0')
.success(function(data) {
$scope.localidad = data.name;
$scope.temperatura = data.main.temp;
$scope.mitemperatura = data.name + ' ' + data.main.temp + ' ºC';
})
.error(function(data, status, headers, config) {
console.debug(data, status, headers, config);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment