I'm displaying a list of items with AngularFire using the ng-repeat
directive. I would like to display headers in the list that are grouped by day. That is, all of the items whose timestamps fall on Jan 23rd, 2015 are under that header.
How might I accomplish that with AngularFire? My concern with altering the structure of the data is that I would lose the synchronicity with the Firebase backend, right? I want to be able to add/remove/edit items in the list with the changes going to/coming from Firebase.
Right now my controller for this list looks like:
app.controller('IssuesController', function($scope, $firebase) {
var ref = new Firebase("[my firebase url]");
var sync = $firebase(ref);
// create a synchronized array for use in our HTML code
$scope.issues = sync.$asArray();
$scope.getIssueIndex = function(issue) {
return Date.parse(issue.timestamp);
}
});