Angular JSON weather app I'm pretty new to Angular. I wrote a weather app and need my code reviewed. I especially need help on best practices for handling edge cases on the response from the JSON endpoint.

Here's the HTML:

&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"&gt;
    &lt;title&gt;&lt;/title&gt;

    &lt;link href="lib/ionic/css/ionic.css" rel="stylesheet"&gt;
    &lt;link href="css/style.css" rel="stylesheet"&gt;

    &lt;!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    &lt;link href="css/ionic.app.css" rel="stylesheet"&gt;
    --&gt;

    &lt;!-- ionic/angularjs js --&gt;
    &lt;script src="lib/ionic/js/ionic.bundle.js"&gt;&lt;/script&gt;

    &lt;!-- cordova script (this will be a 404 during development) --&gt;
    &lt;script src="cordova.js"&gt;&lt;/script&gt;

    &lt;!-- your app's js --&gt;
    &lt;script src="js/app.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body ng-app="starter" ng-controller="apiController"&gt;

    &lt;ion-pane&gt;
        &lt;ion-header-bar class="bar-calm"&gt;
            &lt;h1 class="title"&gt;Kansas City Weather&lt;/h1&gt;
        &lt;/ion-header-bar&gt;
        &lt;ion-content&gt;
            &lt;div ng-repeat="x in myData"&gt;
                &lt;div class="card"&gt;

                    &lt;div class="item item-divider"&gt;
                        Day {{ $index + 1 }}
                    &lt;/div&gt;


                    &lt;div class="row"&gt;
                        &lt;div class="col col-75"&gt;
                            &lt;div class="item item-text-wrap"&gt;
                                {{ x.temp.day }} &amp;#8451;
                            &lt;/div&gt;

                        &lt;/div&gt;
                        &lt;div class="col col-25"&gt;
                            &lt;div class="row"&gt;
                                Max : {{ x.temp.max }} &amp;#8451;
                            &lt;/div&gt;
                            &lt;div class="row"&gt;
                                Min : {{ x.temp.min }} &amp;#8451;
                            &lt;/div&gt;

                        &lt;/div&gt;
                    &lt;/div&gt;
                &lt;/div&gt;   
            &lt;/div&gt;
        &lt;/ion-content&gt;
    &lt;/ion-pane&gt;
&lt;/body&gt;

&lt;/html&gt;


Here's the app.js :

// Ionic Starter App

// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a &lt;body&gt; attribute in index.html)
// the 2nd parameter is an array of 'requires'
var app = angular.module('starter', ['ionic'])

    .run(function($ionicPlatform) {
    $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar                  above the keyboard
    // for form inputs)
    if(window.cordova &amp;&amp; window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
    });
    })


      app.controller('apiController', function($scope, $http) {
    $http.get("http://api.openweathermap.org/data/2.5/forecast/daly?q=Kansas+City&amp;mode=json&amp;units=metric&amp;cnt=10&amp;appid=f6b7081abd94e66273817ed6b5ce95c7").then(function(response) {
        $scope.myData = response.data.list;
    });
});
Your JS could need improvement in terms of indentation. Other than that, your app is pretty small for a full-blown review. However... we can make improvements.

In the long run, your app will be more than just one controller to display different parts of the site. Most of them will be consuming more or less the same data, just displayed a bit differently. You might want to consider using factories/services as data stores, and have controllers just pull them in as dependencies.

This also means your API calls will live there as well, freeing the controller to only be a means to expose data from the services/factories to the templates as well a communicate from template to services/factories.