the html:-
<div class="question" ng-repeat="x in asdf">
<p >{{x}}</p>
</div>
the json:-
$scope.asdf = {
"1": {"question":"Jquery, hide radio button label if not selected","votes": "233", "answers": "2", "views": "2", "tags": "html", "dateString": "Aug 22 2016 16:52", "date": "1471864975000"},
"2": {"question":"Jquery, hide radio button label if not selected","votes": "233", "answers": "2", "views": "2", "tags": "html", "dateString": "Aug 22 2016 16:52", "date": "1471864975000"},
"3": {"question":"Jquery, hide radio button label if not selected","votes": "233", "answers": "2", "views": "2", "tags": "html", "dateString": "Aug 22 2016 16:52", "date": "1471864975000"},
"5": {"question":"Jquery, hide radio button label if not selected","votes": "233", "answers": "2", "views": "2", "tags": "html", "dateString": "Aug 22 2016 16:52", "date": "1471864975000"},
"6": {"question":"Jquery, hide radio button label if not selected","votes": "233", "answers": "2", "views": "2", "tags": "html", "dateString": "Aug 22 2016 16:52", "date": "1471864975000"},
"7": {"question":"Jquery, hide radio button label if not selected","votes": "233", "answers": "2", "views": "2", "tags": "html", "dateString": "Aug 22 2016 16:52", "date": "1471864975000"},
"8": {"question":"Jquery, hide radio button label if not selected","votes": "233", "answers": "2", "views": "2", "tags": "html", "dateString": "Aug 22 2016 16:52", "date": "1471864975000"},
"9": {"question":"Jquery, hide radio button label if not selected","votes": "233", "answers": "2", "views": "2", "tags": "html", "dateString": "Aug 22 2016 16:52", "date": "1471864975000"}
};
This is what i am trying to do, to order it by date (date is a property in json)
<div class="question" ng-repeat="x in asdf | orderBy : date">
<p >{{x}}</p>
</div>
Also tried
<div class="question" ng-repeat="x in asdf | orderBy : x.date">
<div class="question" ng-repeat="x in asdf | orderBy : asdf.date">
nothing seems to work
1 - Why is this not possible ?
2 - What should i do to achieve similar results ?
Note - I want to repeat on the particular div with class="question", don't wanna create another div.