Sort ng-repeat grouping by boolean value

angularjs, angularjs-ng-repeat

Solution

Not quite sure if this is what you're asking but

<div ng-repeat="personData in mydata.peopleRelated | orderBy:'rated'">
  {{personData.personName}} {{personData.rated}}
<div>

sorts the inner loop

Problem

In my angular js attempt, I have a json : ``` [ { "id": "1111", "peopleRelated": [ { "summary": "Manager", "personName": "Suzanne", "personId": 382043, "rated" : true }, { "summary": "VP", "personName": "Dave", "personId": 34532 "rated" : false } ], "title": "Title1", }, { "id": "2222", "peopleRelated": [ { "summary": "Manager", "personName": "Kevin", "personId": 38864 "rated" : true } ], "title": "Title2", } ] ``` And html is following : ``` <div ng-repeat="mydata in data> <div ng-repeat="personData in mydata.peopleRelated"> {{personData.personName}} <div> </div> ``` I wish to sort the personName such as "rated=false" names appear first. How should I go for this? Thanks

Original source