ng-if="$first" means that only if is the first object from ng-repeat="cust
in month" it will show month. It's angular staff. He does that to ensure
that only first row will show month. You can either try $last in place of
$first and Jan Febr etc will show last from their group. Also if you remove
that ng-if all records will have months.
dataByMonth[month] = dataByMonth[month] || [];
dataByMonth[month].push(item);
Inhere he just initialize dataByMonth to be an empty array if doesn't exist.
dataByMonth[month] = (dataByMonth) ? dataByMonth[month] : [];
dataByMonth[month].push(item); // He just push records into months. In
january he push 3 records {id: 1, name: 'Senior'}, {id:2, 'Senior'}, {id:3,
'Adult'}
And in html he do 2 repeat.
1. For month to get all months with their records.
2. Get all records from current month.
Hope this helps. If any other questions i will help you. Sander i hope
you'll not get angry.
A nice day to both of you
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.