I need to set the row span value dynamically based on a condition.
The Array I have:
$scope.approvalitems = [
{ ReqId: '100' Date: '02-02-2015', AssociateID: '346248', },
{ ReqId: '101' Date: '02-02-2015', AssociateID: '346248', },
------------------------------------------
{ ReqId: '102' Date: '06-02-2015', AssociateID: '123456', },
{ ReqId: '103' Date: '06-02-2015', AssociateID: '123456', },
{ ReqId: '104' Date: '06-02-2015', AssociateID: '123456', },
-------------------------------------------
{ ReqId: '105', Date: '07-02-2015', AssociateID: '309645',},
{ ReqId: '106', Date: '07-02-2015', AssociateID: '309645',},
--------------------------------------------
{ ReqId: '107', Date: '08-02-2015', AssociateID: '346248',}
];
Need to set the row span value =(count of items ) having both the DATE and AssociateID values same.
I'm unable to structute the table using ng-repeat , tried using group but unable to get the count of unique elements of Date and AssociateID using groupBy in filter . Looking for an approach to solve this.
Need to get like this.
Date AssociateID Time
-----------|----------|-----------------------
02-02-2015 |346248 | Click here for the time
-----------|----------|
02-02-2015 |346248 |
-----------|----------|----------------------
06-02-2015 |123456 | Click here for the time
-----------|----------|
06-02-2015 |123456 |
-----------|----------|
06-02-2015 |123456 |
-----------|----------|----------------------
07-02-2015 |309645 | Click here for the time
-----------|----------|
07-02-2015 |309645 |
-----------|----------|----------------------
08-02-2015 |346248 | Click here for the time
Here is my Fiddle
So how to acheive this , should i need to sort it before binding the array , if so pls guide me or is there any better way to acheive this.I'm a newbie to angular js.