AngularJS

Weather

by Dennis Betman

HTML

<body ng-app="MyApp">
    <div ng-controller="PostsCtrl">
        <li>{{posts.city_name}}</li>
    </div>
</body>

JavaScript

var app = angular.module("MyApp", []);

var url = "http://api.openweathermap.org/data/2.5/weather?q=London,uk";

app.controller("PostsCtrl", function($scope, $http) {
  $http.get(test).
    success(function(data, status, headers, config) {
      $scope.posts = data;
      console.log("success");
    }).
    error(function(data, status, headers, config) {
      console.log("Failed");
    });
});