title: Web sql/Sql Lite and Binding to Row in Angular
body: <p>This is for a phonegap angular app.  I would have thought binding to the db query return, <code>result.rows</code> in my case would be possible but it seems like it is not.   The only way I could get this to work was with the commented out code where I manually push the data into an array row by row.  Is this the only way?</p>
  
  <p>The actually error received by binding to <code>.rows</code> is:  <code>Error: Duplicates in a repeater are not allowed. Repeater: item in items key: undefined:undefined</code></p>
  
  <p>The service:</p>
  
  <pre><code>// only portion of code shown
  query: function (q) {
          var d = $q.defer();
          var db = this.getDb();
  
          db.transaction(function (t) {
              t.executeSql(q, [], function (tx, results) {
                  d.resolve(results);
              }, function (err) {
                  d.reject(err);
              });
  
          }, function (err) {
              d.reject(err);
          }
          );
  
          return d.promise;
       }
  </code></pre>
  
  <p>The controller is like this:</p>
  
  <pre><code>  Sql.query('select * from DEMO').then(function (data) {
                  console.log(data);
                  //$scope.items = [];
  
                  //for (i = 0, l = data.rows.length; i &lt; l; i++) {
                      //$scope.items.push(data.rows.item(i));
                  //}
  
                  $scope.items = data.rows;  // this errors out
                  $scope.$safeApply();
              });
  </code></pre>
  
  <p>The repeater is just a simple:</p>
  
  <pre><code>&lt;div ng-repeat='item in items'&gt;{{item.id}} {{item.data}}&lt;/div&gt;
  </code></pre>