title: AngularJS ng-repeat doesn't render on page load
body: <p>I've been using AngularJS in conjunction with Cordova, and recently some strange events have been happening. On random occasions when the page first loads the ng-repeat will not render out the list, however, the data is in local WebSQL and the query is bringing back the data everytime as I tell JavaScript to console.log the data everytime.</p>
  
  <p>WebSQL becomes populated on login, the login in function will send a request to an API, gather some data and then store it. Once the page hasn't loaded the data normally I would navigate to another page and then back. At this point the list would of appeared. The technologies I am using is IonicFramework (Downloaded the latest stable from yesterday), Cordova and finally RequireJS.</p>
  
  <p><strong>JavaScript Controller</strong> </p>
  
  <pre><code>// Run the query to gather the applications which are locally stored within the database
  $scope.appData = ApplicationService.get_applications();
  </code></pre>
  
  <p><strong>ApplicationService</strong></p>
  
  <pre><code>/*global define, console */
  
  define(['angular'], function (angular) {
      "use strict";
  
      var factory = function (ConfigurationService, DatabaseService) {
  
          return {
  
              // GET ALL APPLICATIONS SAVED IN SQLITE
              get_applications: function () {
                  var i = 0, data = [];
                  DatabaseService.raw().query('SELECT * FROM applications', function (tx, res) {
                      if (res.rows.length &gt; 0) {
                          for (i; i &lt; res.rows.length; i += 1) {
                              data[i] = {
                                  'first_name': res.rows.item(i).first_name,
                                  'last_name': res.rows.item(i).last_name,
                                  'name': res.rows.item(i).name,
                                  'application_id': res.rows.item(i).application_id
                              }
                          }
                      }
                  });
  
                  return data;
              },
  
  
          };
  
      };
  
      factory.$inject = ['ConfigurationService', 'DatabaseService'];
      return factory;
  });
  </code></pre>
  
  <p><strong>View File</strong></p>
  
  <pre><code>            &lt;ion-list&gt;
                  &lt;ion-item ng-repeat="data in appData"&gt;
                      &lt;a ng-click="highlight({{ data.application_id }})" id="{{ data.application_id }}" class="" title="{{ data.name }}"&gt;
                          &lt;h2&gt;{{ data.first_name }} {{ data.last_name }} &lt;p&gt;{{ data.name }}&lt;/p&gt;&lt;/h2&gt;
                      &lt;/a&gt;
                  &lt;/ion-item&gt;
              &lt;/ion-list&gt;
  </code></pre>
  
  <p>Some help would be gratefully appreciated as this is considered a major bug within my application.</p>