Created
January 25, 2016 15:22
-
-
Save MARIAEL/1cfe0059d55286c5cd28 to your computer and use it in GitHub Desktop.
proyecto zapatones
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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