Last active
August 29, 2015 14:03
-
-
Save auser/3917436d8a6f0fcfc455 to your computer and use it in GitHub Desktop.
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
angular.module('myApp', []) | |
.controller('HomeController', function($scope) { | |
// Fill in the blanks to get weather | |
// on to the scope | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Blank</title> | |
</head> | |
<body> | |
<div ng-controller='HomeController'> | |
<div class="weather"> | |
The weather is {{ weather.temperature }} | |
</div> | |
</div> | |
<script src="js/angular.js"></script> | |
<script src="js/app.js"></script> | |
</body> | |
</html> |
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
var getData = function(q) { | |
var url = "http://api.openweathermap.org/data/2.5/"+ | |
"forecast/daily?mode=json" + | |
"&units=imperial&cnt=1" + | |
"&q=" | |
return $http({ | |
method: 'JSONP', | |
url: url + q, | |
params: { | |
callback: 'JSON_CALLBACK' | |
} | |
}).success(function(data, status) { | |
return data; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment