1

I have

$scope.arrays = [{status:"active", name="John", id:1},{status:"inactive", name:"Deo", id:2},{status:"inactive", name:"Deo", id:3}]

what I have done is

<li ng-repeat="a in arrays | unique:'status'">{{a.status}}</li>

unique status doesnt list unique status. On ng-click I want to filter a table based on its status.

I have used

        <li ng-click='myfilter = {status: "active"}'><a>Active</a></li>
        <li ng-click='myfilter = {status: "inactive"}'><a>Inactive</a></li> 

But I want to do this dynamically from the ng-repeat.

Another problem i'm facing is I want to add class active to it onclick, have referenced so many tutorials but all fails.Please give me some insights.

JyotiChhetri
  • 289
  • 1
  • 7
  • 21
  • Incorrect json. Values should be mapped to the keys using colon. `{status:'active'}` – AlwaysALearner Jul 24 '14 at 12:12
  • How is it possible to get unique status from repeat then ? – JyotiChhetri Jul 24 '14 at 12:37
  • possible duplicate of [Angular JS - How to make ng-repeat filter out duplicate results](http://stackoverflow.com/questions/15914658/angular-js-how-to-make-ng-repeat-filter-out-duplicate-results) – alex Feb 27 '15 at 17:06

0 Answers0