1

I'm getting crazy to create a list separated by year and month name...

I would like to have something like:

Events in 2015
January
- event 1
- event 2
- event 3
February
- event 1
- event 2
...ecc...
Events in 2016
...ecc...

I don't think I have to create a repeater for each Year and Month, right? I think there is a filter or a rule to achieve this.

<div ng-app ng-controller="Main">
   <div ng-repeat="event in events | what here?">
        // how to create separators here?
        {{event.title}}
   </div>
</div>


$scope.events = [
    {id: 1, title: "Title 1", date: 283764873126}, 
    {id: 2, title: "Title 2", date: 283764873126}, 
    {id: 3, title: "Title 3", date: 283764873126}, 
    {id: 4, title: "Title 4", date: 283764873126}
];
Ayeye Brazo
  • 3,316
  • 7
  • 34
  • 67
  • 4
    possible duplicate of [Angular ng-repeat conditional wrap items in element (group items in ng-repeat)](http://stackoverflow.com/questions/23493063/angular-ng-repeat-conditional-wrap-items-in-element-group-items-in-ng-repeat) – Alexis King Jan 29 '15 at 19:10
  • Then please don't forget to close the question – Valentin Waeselynck Jan 29 '15 at 20:59

0 Answers0