My table won't display the data it receives after a promise resolves. The data, however, is shown after a filter query is updated.
Angular:
let app = angular.module("tierlist", []);
app.controller("tierListController", function ($scope, $http) {
firebase.database().ref('/Primaries/').once('value').then(function (snapshot) {
console.log(snapshot.val());
$scope.Primaries = $.map(snapshot.val(), function (element) {
return element;
});
console.log($scope.Primaries);
});
});
HTML:
<div class="container tiertab" id="Primaries">
<table id="primariesTable" class="table table-condensed table-responsive sortable">
<thead>
<tr>
<th onclick="sortTable('primariesTable', 0)">Rank</th>
<th onclick="sortTable('primariesTable', 1)">Weapons</th>
<th onclick="sortTable('primariesTable', 2)">Primary DMG Type</th>
<th onclick="sortTable('primariesTable', 3)">CC Mechanic</th>
<th onclick="sortTable('primariesTable', 4)">MR Req</th>
<th>Notes</th>
<th>Base or Event Rankings</th>
<th>Suggested Builds</th>
</tr>
</thead>
<tbody>
<tr class="sortable" ng-repeat="primary in Primaries | filter: $ctrl.query" >
<td>{{primary.rank}}</td>
<td>{{primary.name}}</td>
<td>{{primary.damage}}</td>
<td>{{primary.cc}}</td>
<td>{{primary.mr}}</td>
<td>{{primary.notes}}</td>
<td>{{primary.event}}</td>
<td>{{primary.builds}}</td>
</tr>
</tbody>
</table>
</div>
I believe I'm doing something wrong as far as the controller is involved. If the data is associated with the given fields, why would the data not display after resolving the promise?