Search Posts

Category: sorting

How to order a dictionary by value in AngularJS

I’ve a REST api that returns the list of locales as dictionary: { “en-uk”: “English UK”, “en-us”: “English USA”, … } This dictionary is correctly ordered alphabetically by value. When AngularJS receives it via HTTP, the dictionary gets automatically re-sorted by key, so when I bind to a select element the list of options is ordered by key, and the alphabetical order by key doesn’t match the one by value, I get a wrong sorting. […]

Sort by value in ng-repeat (key, value) pair from object

I’m new to AngularJS. Using API I am getting key – value pair with sports $scope.sports = { 1: “Soccer”, 2: “Tennis”, 3: “Basketball” … }; Is this possible to sort items by sport name: <ul> <li ng-repeat=”(id, value) in sports | orderBy:’value'”> <a ng-href=’/page/{{id}}’>{{value}}</a> </li> </ul> this doesn’t work at all https://jsfiddle.net/ak657soa/1/ now is ——————– Soccer // id: 1 Tennis // id: 2 Basketball // id: 3 MMA // id: 4 Street dance // […]

Angular: Display based on different categories

In Angular: I have the below JSON object: $scope.catItems = [ {cat: ‘A’, desc: ‘lorem ipsum’, tags: ”, name: ‘abc’, link: ‘www.google.com’}, {cat: ‘B’, desc: ‘I am here too’, tags: ”, name: ‘def’, link: ‘www.google.com’}, {cat: ‘C’, desc: ‘So am I’, tags: ”, name: ‘ghi’, link: ‘www.google.com’}, {cat: ‘D’, desc: ‘Where is the sky’, tags: ”, name: ‘jkl’, link: ‘www.google.com’}, {cat: ‘A’, desc: ‘I really don’t know’, tags: ”, name: ‘mno’, link: ‘www.google.com’}, {cat: ‘A’, […]

Sort an object with an array and store values in another array

I have a object parameter with a property and value like $scope.chartOptions.response.items.count = { amazing: 8, amenities: 6, awesome: 7, beautiful: 15, better: 9, clean: 12, comfortable: 8, complaint: 6, definitely stay: 6, excellent: 11, friendly: 17, front desk: 8, good: 15, gorgeous: 6, great: 28, helpful: 11, nice: 15, perfect: 7, the best: 10, wonderful: 12 } The array has value of 20 indexes. The array looks like series[] = [“great”, “friendly”, “good”, “beautiful”, […]

Sorting data by date using orderBy sorts data only by number of the day not by year. [AngularJS]

how to Sorting data by date using orderBy sorts data only by number of the day not by year. [AngularJS] I want to sort data by date using OrderBy in AngularJS and show the latest data on the basis of it. The problem is that the orderBy is sorting data taking only the day into consideration. I want it to consider all the factors like month and year. Here is the code I am working […]

Filtering is not working on Array of objects in AngularJS

I have list of products as array of object. Want to display that based on highest views count. I tried to use “orderBy” service. But it’s not filtering from my attached array of object. Any suggestion about how to do that? vm.products = [ { title : ‘ABC’, imgSrc: ‘../../images/product1.png’, viewsCount: ‘183’, clicksCount: ’34’ }, { title : ‘DEF’, imgSrc: ‘../../images/product1.png’, viewsCount: ‘158’, clicksCount: ’30’ }, { title : ‘GHI’, imgSrc: ‘../../images/product1.png’, viewsCount: ’86’, clicksCount: […]

Getting unexpected error while sorting the drop down value using Angular.js

I am getting some error while sorting my drop down value alphabetically using Angular.js. I am explaining my code below. <div ng-dropdown-multiselect=”” options=”example16data | orderBy:’label'” selected-model=”example16model” checkboxes=”true” extra-settings=”example16settings” class=”form-control”></div> angular.forEach(response.data,function(obj){ var data={‘label’:obj.cat_name+’:’+obj.subcat_name,’id’:obj.subcat_id}; $scope.example16data.push(data); }) Here I am using Anguar’s angularjs-dropdown-multiselect for drop down list but when I am trying to sorting the list I am getting the following unexpected error. Uncaught Error: [$rootScope:infdig] http://errors.angularjs.org/1.4.6/$rootScope/infdig?p0=10&p1=%5B%5B%7B%22msg%22%3A%22fn%3A%20function%20(c%2Cd%2Ce%2Cf)%7Be%3Da(c%2C%5Cr%5Cnd%2Ce%2Cf)%3Breturn%20b(e%2Cc%2Cd)%7D%22%2C%22newVal%22%3A%5B%7B%22label%22%3A%22DRINKS%3ABEER%22%2C%22id%22%3A%2250%22%2C%22%24%24hashKey%22%3A%22object%3A341%22%7D%2C%7B%22label%22%3A%22DRINKS%3ACOCKTAILS%22%2C%22id%22%3A%2257%22%2C%22%24%24hashKey%22%3A%22object%3A342%22%7D%2C%7B%22label%22%3A%22DRINKS%3AWINE%22%2C%22id%22%3A%2251%22%2C%22%24%24hashKey%22%3A%22object%3A343%22%7D%2C%7B%22label%22%3A%22FOOD%3AAPPETIZERS%22%2C%22id%22%3A%2220%22%2C%22%24%24hashKey%22%3A%22object%3A344%22%7D%2C%7B%22label%22%3A%22FOOD%3ABREAKFAST%22%2C%22id%22%3A%2228%22%2C%22%24%24hashKey%22%3A%22object%3A345%22%7D%2C%7B%22label%22%3A%22FOOD%3ABRUNCH%22%2C%22id%22%3A%2226%22%2C%22%24%24hashKey%22%3A%22object%3A346%22%7D%2C%7B%22label%22%3A%22FOOD%3ACHINESE%22%2C%22id%22%3A%226%22%2C%22%24%24hashKey%22%3A%22object%3A347%22%7D%2C%7B%22label%22%3A%22FOOD%3AGREEK%22%2C%22id%22%3A%2218%22%2C%22%24%24hashKey%22%3A%22object%3A348%22%7D%2C%7B%22label%22%3A%22FOOD%3AINDIAN%22%2C%22id%22%3A%2224%22%2C%22%24%24hashKey%22%3A%22object%3A349%22%7D%2C%7B%22label%22%3A%22FOOD%3AITALIAN%22%2C%22id%22%3A%227%22%2C%22%24%24hashKey%22%3A%22object%3A350%22%7D%2C%7B%22label%22%3A%22FOOD%3ALATE%20NIGHT%22%2C%22id%22%3A%2247%22%2C%22%24%24hashKey%22%3A%22object%3A351%22%7D%2C%7B%22label%22%3A%22FOOD%3ALUNCH%22%2C%22id%22%3A%2227%22%2C%22%24%24hashKey%22%3A%22object%3A352%22%7D%2C%7B%22label%22%3A%22FOOD%3APIZZA%22%2C%22id%22%3A%225%22%2C%22%24%24hashKey%22%3A%22object%3A353%22%7D%2C%7B%22label%22%3A%22FOOD%3ASEAFOOD%22%2C%22id%22%3A%2244%22%2C%22%24%24hashKey%22%3A%22object%3A354%22%7D%2C%7B%22label%22%3A%22FOOD%3ASUSHI%22%2C%22id%22%3A%229%22%2C%22%24%24hashKey%22%3A%22object%3A355%22%7D%2C%7B%22label%22%3A%22FOOD%3ATHAI%22%2C%22id%22%3A%2211%22%2C%22%24%24hashKey%22%3A%22object%3A356%22%7D%2C%7B%22label%22%3A%22FOOD%3AVIETNAMESE%22%2C%22id%22%3A%228%22%2C%22%24%24hashKey%22%3A%22object%3A357%22%7D%2C%7B%22label%22%3A%22FOOD%3AWINGS%22%2C%22id%22%3A%2219%22%2C%22%24%24hashKey%22%3A%22object%3A358%22%7D%2C%7B%22label%22%3A%22HAPPY%20HOUR%3AHAPPY%20HOUR%22%2C%22id%22%3A%2242%22%2C%22%24%24hashKey%22%3A%22object%3A359%22%7D%5D%2C%22oldVal%22%3A%5B%7B%22label%22%3A%22DRINKS%3ABEER%22%2C%22id%22%3A%2250%22%2C%22%24%24hashKey%22%3A%22object%3A341%22%7D%2C%7B%22label%22%3A%22DRINKS%3ACOCKTAILS%22%2C%22id%22%3A%2257%22%2C%22%24%24hashKey%22%3A%22object%3A342%22%7D%2C%7B%22label%22%3A%22DRINKS%3AWINE%22%2C%22id%22%3A%2251%22%2C%22%24%24hashKey%22%3A%22object%3A343%22%7D%2C%7B%22label%22%3A%22FOOD%3AAPPETIZERS%22%2C%22id%22%3A%2220%22%2C%22%24%24hashKey%22%3A%22object%3A344%22%7D%2C%7B%22label%22%3A%22FOOD%3ABREAKFAST%22%2C%22id%22%3A%2228%22%2C%22%24%24hashKey%22%3A%22object%3A345%22%7D%2C%7B%22label%22%3A%22FOOD%3ABRUNCH%22%2C%22id%22%3A%2226%22%2C%22%24%24hashKey%22%3A%22object%3A346%22%7D%2C%7B%22label%22%3A%22FOOD%3ACHINESE%22%2C%22id%22%3A%226%22%2C%22%24%24hashKey%22%3A%22object%3A347%22%7D%2C%7B%22label%22%3A%22FOOD%3AGREEK%22%2C%22id%22%3A%2218%22%2C%22%24%24hashKey%22%3A%22object%3A348%22%7D%2C%7B%22label%22%3A%22FOOD%3AINDIAN%22%2C%22id%22%3A%2224%22%2C%22%24%24hashKey%22%3A%22object%3A349%22%7D%2C%7B%22label%22%3A%22FOOD%3AITALIAN%22%2C%22id%22%3A%227%22%2C%22%24%24hashKey%22%3A%22object%3A350%22%7D%2C%7B%22label%22%3A%22FOOD%3ALATE%20NIGHT%22%2C%22id%22%3A%2247%22%2C%22%24%24hashKey%22%3A%22object%3A351%22%7D%2C%7B%22label%22%3A%22FOOD%3ALUNCH%22%2C%22id%22%3A%2227%22%2C%22%24%24hashKey%22%3A%22object%3A352%22%7D%2C%7B%22label%22%3A%22FOOD%3APIZZA%22%2C%22id%22%3A%225%22%2C%22%24%24hashKey%22%3A%22object%3A353%22%7D%2C%7B%22label%22%3A%22FOOD%3ASEAFOOD%22%2C%22id%22%3A%2244%22%2C%22%24%24hashKey%22%3A%22object%3A354%22%7D%2C%7B%22label%22%3A%22FOOD%3ASUSHI%22%2C%22id%22%3A%229%22%2C%22%24%24hashKey%22%3A%22object%3A355%22%7D%2C%7B%22label%22%3A%22FOOD%3ATHAI%22%2C%22id%22%3A%2211%22%2C%22%24%24hashKey%22%3A%22object%3A356%22%7D%2C%7B%22label%22%3A%22FOOD%3AVIETNAMESE%22%2C%22id%22%3A%228%22%2C%22%24%24hashKey%22%3A%22object%3A357%22%7D%2C%7B%22label%22%3A%22FOOD%3AWINGS%22%2C%22id%22%3A%2219%22%2C%22%24%24hashKey%22%3A%22object%3A358%22%7D%2C%7B%22label%22%3A%22HAPPY%20HOUR%3AHAPPY%20HOUR%22%2C%22id%22%3A%2242%22%2C%22%24%24hashKey%22%3A%22object%3A359%22%7D%5D%7D%5D%2C%5B%7B%22msg%22%3A%22fn%3A%20function%20(c%2Cd%2Ce%2Cf)%7Be%3Da(c%2C%5Cr%5Cnd%2Ce%2Cf)%3Breturn%20b(e%2Cc%2Cd)%7D%22%2C%22newVal%22%3A%5B%7B%22label%22%3A%22DRINKS%3ABEER%22%2C%22id%22%3A%2250%22%2C%22%24%24hashKey%22%3A%22object%3A341%22%7D%2C%7B%22label%22%3A%22DRINKS%3ACOCKTAILS%22%2C%22id%22%3A%2257%22%2C%22%24%24hashKey%22%3A%22object%3A342%22%7D%2C%7B%22label%22%3A%22DRINKS%3AWINE%22%2C%22id%22%3A%2251%22%2C%22%24%24hashKey%22%3A%22object%3A343%22%7D%2C%7B%22label%22%3A%22FOOD%3AAPPETIZERS%22%2C%22id%22%3A%2220%22%2C%22%24%24hashKey%22%3A%22object%3A344%22%7D%2C%7B%22label%22%3A%22FOOD%3ABREAKFAST%22%2C%22id%22%3A%2228%22%2C%22%24%24hashKey%22%3A%22object%3A345%22%7D%2C%7B%22label%22%3A%22FOOD%3ABRUNCH%22%2C%22id%22%3A%2226%22%2C%22%24%24hashKey%22%3A%22object%3A346%22%7D%2C%7B%22label%22%3A%22FOOD%3ACHINESE%22%2C%22id%22%3A%226%22%2C%22%24%24hashKey%22%3A%22object%3A347%22%7D%2C%7B%22label%22%3A%22FOOD%3AGREEK%22%2C%22id%22%3A%2218%22%2C%22%24%24hashKey%22%3A%22object%3A348%22%7D%2C%7B%22label%22%3A%22FOOD%3AINDIAN%22%2C%22id%22%3A%2224%22%2C%22%24%24hashKey%22%3A%22object%3A349%22%7D%2C%7B%22label%22%3A%22FOOD%3AITALIAN%22%2C%22id%22%3A%227%22%2C%22%24%24hashKey%22%3A%22object%3A350%22%7D%2C%7B%22label%22%3A%22FOOD%3ALATE%20NIGHT%22%2C%22id%22%3A%2247%22%2C%22%24%24hashKey%22%3A%22object%3A351%22%7D%2C%7B%22label%22%3A%22FOOD%3ALUNCH%22%2C%22id%22%3A%2227%22%2C%22%24%24hashKey%22%3A%22object%3A352%22%7D%2C%7B%22label%22%3A%22FOOD%3APIZZA%22%2C%22id%22%3A%225%22%2C%22%24%24hashKey%22%3A%22object%3A353%22%7D%2C%7B%22label%22%3A%22FOOD%3ASEAFOOD%22%2C%22id%22%3A%2244%22%2C%22%24%24hashKey%22%3A%22object%3A354%22%7D%2C%7B%22label%22%3A%22FOOD%3ASUSHI%22%2C%22id%22%3A%229%22%2C%22%24%24hashKey%22%3A%22object%3A355%22%7D%2C%7B%22label%22%3A%22FOOD%3ATHAI%22%2C%22id%22%3A%2211%22%2C%22%24%24hashKey%22%3A%22object%3A356%22%7D%2C%7B%22label%22%3A%22FOOD%3AVIETNAMESE%22%2C%22id%22%3A%228%22%2C%22%24%24hashKey%22%3A%22object%3A357%22%7D%2C%7B%22label%22%3A%22FOOD%3AWINGS%22%2C%22id%22%3A%2219%22%2C%22%24%24hashKey%22%3A%22object%3A358%22%7D%2C%7B%22label%22%3A%22HAPPY%20HOUR%3AHAPPY%20HOUR%22%2C%22id%22%3A%2242%22%2C%22%24%24hashKey%22%3A%22object%3A359%22%7D%5D%2C%22oldVal%22%3A%5B%7B%22label%22%3A%22DRINKS%3ABEER%22%2C%22id%22%3A%2250%22%2C%22%24%24hashKey%22%3A%22object%3A341%22%7D%2C%7B%22label%22%3A%22DRINKS%3ACOCKTAILS%22%2C%22id%22%3A%2257%22%2C%22%24%24hashKey%22%3A%22object%3A342%22%7D%2C%7B%22label%22%3A%22DRINKS%3AWINE%22%2C%22id%22%3A%2251%22%2C%22%24%24hashKey%22%3A%22object%3A343%22%7D%2C%7B%22label%22%3A%22FOOD%3AAPPETIZERS%22%2C%22id%22%3A%2220%22%2C%22%24%24hashKey%22%3A%22object%3A344%22%7D%2C%7B%22label%22%3A%22FOOD%3ABREAKFAST%22%2C%22id%22%3A%2228%22%2C%22%24%24hashKey%22%3A%22object%3A345%22%7D%2C%7B%22label%22%3A%22FOOD%3ABRUNCH%22%2C%22id%22%3A%2226%22%2C%22%24%24hashKey%22%3A%22object%3A346%22%7D%2C%7B%22label%22%3A%22FOOD%3ACHINESE%22%2C%22id%22%3A%226%22%2C%22%24%24hashKey%22%3A%22object%3A347%22%7D%2C%7B%22label%22%3A%22FOOD%3AGREEK%22%2C%22id%22%3A%2218%22%2C%22%24%24hashKey%22%3A%22object%3A348%22%7D%2C%7B%22label%22%3A%22FOOD%3AINDIAN%22%2C%22id%22%3A%2224%22%2C%22%24%24hashKey%22%3A%22object%3A349%22%7D%2C%7B%22label%22%3A%22FOOD%3AITALIAN%22%2C%22id%22%3A%227%22%2C%22%24%24hashKey%22%3A%22object%3A350%22%7D%2C%7B%22label%22%3A%22FOOD%3ALATE%20NIGHT%22%2C%22id%22%3A%2247%22%2C%22%24%24hashKey%22%3A%22object%3A351%22%7D%2C%7B%22label%22%3A%22FOOD%3ALUNCH%22%2C%22id%22%3A%2227%22%2C%22%24%24hashKey%22%3A%22object%3A352%22%7D%2C%7B%22label%22%3A%22FOOD%3APIZZA%22%2C%22id%22%3A%225%22%2C%22%24%24hashKey%22%3A%22object%3A353%22%7D%2C%7B%22label%22%3A%22FOOD%3ASEAFOOD%22%2C%22id%22%3A%2244%22%2C%22%24%24hashKey%22%3A%22object%3A354%22%7D%2C%7B%22label%22%3A%22FOOD%3ASUSHI%22%2C%22id%22%3A%229%22%2C%22%24%24hashKey%22%3A%22object%3A355%22%7D%2C%7B%22label%22%3A%22FOOD%3ATHAI%22%2C%22id%22%3A%2211%22%2C%22%24%24hashKey%22%3A%22object%3A356%22%7D%2C%7B%22label%22%3A%22FOOD%3AVIETNAMESE%22%2C%22id%22%3A%228%22%2C%22%24%24hashKey%22%3A%22object%3A357%22%7D%2C%7B%22label%22%3A%22FOOD%3AWINGS%22%2C%22id%22%3A%2219%22%2C%22%24%24hashKey%22%3A%22object%3A358%22%7D%2C%7B%22label%22%3A%22HAPPY%20HOUR%3AHAPPY%20HOUR%22%2C%22id%22%3A%2242%22%2C%22%24%24hashKey%22%3A%22object%3A359%22%7D%5D%7D%5D%2C%5B%7B%22msg%22%3A%22fn%3A%20function%20(c%2Cd%2Ce%2Cf)%7Be%3Da(c%2C%5Cr%5Cnd%2Ce%2Cf)%3Breturn%20b(e%2Cc%2Cd)%7D%22%2C%22newVal%22%3A%5B%7B%22label%22%3A%22DRINKS%3ABEER%22%2C%22id%22%3A%2250%22%2C%22%24%24hashKey%22%3A%22object%3A341%22%7D%2C%7B%22label%22%3A%22DRINKS%3ACOCKTAILS%22%2C%22id%22%3A%2257%22%2C%22%24%24hashKey%22%3A%22object%3A342%22%7D%2C%7B%22label%22%3A%22DRINKS%3AWINE%22%2C%22id%22%3A%2251%22%2C%22%24%24hashKey%22%3A%22object%3A343%22%7D%2C%7B%22label%22%3A%22FOOD%3AAPPETIZERS%22%2C%22id%22%3A%2220%22%2C%22%24%24hashKey%22%3A%22object%3A344%22%7D%2C%7B%22label%22%3A%22FOOD%3ABREAKFAST%22%2C%22id%22%3A%2228%22%2C%22%24%24hashKey%22%3A%22object%3A345%22%7D%2C%7B%22label%22%3A%22FOOD%3ABRUNCH%22%2C%22id%22%3A%2226%22%2C%22%24%24hashKey%22%3A%22object%3A346%22%7D%2C%7B%22label%22%3A%22FOOD%3ACHINESE%22%2C%22id%22%3A%226%22%2C%22%24%24hashKey%22%3A%22object%3A347%22%7D%2C%7B%22label%22%3A%22FOOD%3AGREEK%22%2C%22id%22%3A%2218%22%2C%22%24%24hashKey%22%3A%22object%3A348%22%7D%2C%7B%22label%22%3A%22FOOD%3AINDIAN%22%2C%22id%22%3A%2224%22%2C%22%24%24hashKey%22%3A%22object%3A349%22%7D%2C%7B%22label%22%3A%22FOOD%3AITALIAN%22%2C%22id%22%3A%227%22%2C%22%24%24hashKey%22%3A%22object%3A350%22%7D%2C%7B%22label%22%3A%22FOOD%3ALATE%20NIGHT%22%2C%22id%22%3A%2247%22%2C%22%24%24hashKey%22%3A%22object%3A351%22%7D%2C%7B%22label%22%3A%22FOOD%3ALUNCH%22%2C%22id%22%3A%2227%22%2C%22%24%24hashKey%22%3A%22object%3A352%22%7D%2C%7B%22label%22%3A%22FOOD%3APIZZA%22%2C%22id%22%3A%225%22%2C%22%24%24hashKey%22%3A%22object%3A353%22%7D%2C%7B%22label%22%3A%22FOOD%3ASEAFOOD%22%2C%22id%22%3A%2244%22%2C%22%24%24hashKey%22%3A%22object%3A354%22%7D%2C%7B%22label%22%3A%22FOOD%3ASUSHI%22%2C%22id%22%3A%229%22%2C%22%24%24hashKey%22%3A%22object%3A355%22%7D%2C%7B%22label%22%3A%22FOOD%3ATHAI%22%2C%22id%22%3A%2211%22%2C%22%24%24hashKey%22%3A%22object%3A356%22%7D%2C%7B%22label%22%3A%22FOOD%3AVIETNAMESE%22%2C%22id%22%3A%228%22%2C%22%24%24hashKey%22%3A%22object%3A357%22%7D%2C%7B%22label%22%3A%22FOOD%3AWINGS%22%2C%22id%22%3A%2219%22%2C%22%24%24hashKey%22%3A%22object%3A358%22%7D%2C%7B%22label%22%3A%22HAPPY%20HOUR%3AHAPPY%20HOUR%22%2C%22id%22%3A%2242%22%2C%22%24%24hashKey%22%3A%22object%3A359%22%7D%5D%2C%22oldVal%22%3A%5B%7B%22label%22%3A%22DRINKS%3ABEER%22%2C%22id%22%3A%2250%22%2C%22%24%24hashKey%22%3A%22object%3A341%22%7D%2C%7B%22label%22%3A%22DRINKS%3ACOCKTAILS%22%2C%22id%22%3A%2257%22%2C%22%24%24hashKey%22%3A%22object%3A342%22%7D%2C%7B%22label%22%3A%22DRINKS%3AWINE%22%2C%22id%22%3A%2251%22%2C%22%24%24hashKey%22%3A%22object%3A343%22%7D%2C%7B%22label%22%3A%22FOOD%3AAPPETIZERS%22%2C%22id%22%3A%2220%22%2C%22%24%24hashKey%22%3A%22object%3A344%22%7D%2C%7B%22label%22%3A%22FOOD%3ABREAKFAST%22%2C%22id%22%3A%2228%22%2C%22%24%24hashKey%22%3A%22object%3A345%22%7D%2C%7B%22label%22%3A%22FOOD%3ABRUNCH%22%2C%22id%22%3A%2226%22%2C%22%24%24hashKey%22%3A%22object%3A346%22%7D%2C%7B%22label%22%3A%22FOOD%3ACHINESE%22%2C%22id%22%3A%226%22%2C%22%24%24hashKey%22%3A%22object%3A347%22%7D%2C%7B%22label%22%3A%22FOOD%3AGREEK%22%2C%22id%22%3A%2218%22%2C%22%24%24hashKey%22%3A%22object%3A348%22%7D%2C%7B%22label%22%3A%22FOOD%3AINDIAN%22%2C%22id%22%3A%2224%22%2C%22%24%24hashKey%22%3A%22object%3A349%22%7D%2C%7B%22label%22%3A%22FOOD%3AITALIAN%22%2C%22id%22%3A%227%22%2C%22%24%24hashKey%22%3A%22object%3A350%22%7D%2C%7B%22label%22%3A%22FOOD%3ALATE%20NIGHT%22%2C%22id%22%3A%2247%22%2C%22%24%24hashKey%22%3A%22object%3A351%22%7D%2C%7B%22label%22%3A%22FOOD%3ALUNCH%22%2C%22id%22%3A%2227%22%2C%22%24%24hashKey%22%3A%22object%3A352%22%7D%2C%7B%22label%22%3A%22FOOD%3APIZZA%22%2C%22id%22%3A%225%22%2C%22%24%24hashKey%22%3A%22object%3A353%22%7D%2C%7B%22label%22%3A%22FOOD%3ASEAFOOD%22%2C%22id%22%3A%2244%22%2C%22%24%24hashKey%22%3A%22object%3A354%22%7D%2C%7B%22label%22%3A%22FOOD%3ASUSHI%22%2C%22id%22%3A%229%22%2C%22%24%24hashKey%22%3A%22object%3A355%22%7D%2C%7B%22label%22%3A%22FOOD%3ATHAI%22%2C%22id%22%3A%2211%22%2C%22%24%24hashKey%22%3A%22object%3A356%22%7D%2C%7B%22label%22%3A%22FOOD%3AVIETNAMESE%22%2C%22id%22%3A%228%22%2C%22%24%24hashKey%22%3A%22object%3A357%22%7D%2C%7B%22label%22%3A%22FOOD%3AWINGS%22%2C%22id%22%3A%2219%22%2C%22%24%24hashKey%22%3A%22object%3A358%22%7D%2C%7B%22label%22%3A%22HAPPY%20HOUR%3AHAPPY%20HOUR%22%2C%22id%22%3A%2242%22%2C%22%24%24hashKey%22%3A%22object%3A359%22%7D%5D%7D%5D%2C%5B%7B%22msg%22%3A%22fn%3A%20function%20(c%2Cd%2Ce%2Cf)%7Be%3Da(c%2C%5Cr%5Cnd%2Ce%2Cf)%3Breturn%20b(e%2Cc%2Cd)%7D%22%2C%22newVal%22%3A%5B%7B%22label%22%3A%22DRINKS%3ABEER%22%2C%22id%22%3A%2250%22%2C%22%24%24hashKey%22%3A%22object%3A341%22%7D%2C%7B%22label%22%3A%22DRINKS%3ACOCKTAILS%22%2C%22id%22%3A%2257%22%2C%22%24%24hashKey%22%3A%22object%3A342%22%7D%2C%7B%22label%22%3A%22DRINKS%3AWINE%22%2C%22id%22%3A%2251%22%2C%22%24%24hashKey%22%3A%22object%3A343%22%7D%2C%7B%22label%22%3A%22FOOD%3AAPPETIZERS%22%2C%22id%22%3A%2220%22%2C%22%24%24hashKey%22%3A%22object%3A344%22%7D%2C%7B%22label%22%3A%22FOOD%3ABREAKFAST%22%2C%22id%22%3A%2228%22%2C%22%24%24hashKey%22%3A%22object%3A345%22%7D%2C%7B%22label%22%3A%22FOOD%3ABRUNCH%22%2C%22id%22%3A%2226%22%2C%22%24%24hashKey%22%3A%22object%3A346%22%7D%2C%7B%22label%22%3A%22FOOD%3ACHINESE%22%2C%22id%22%3A%226%22%2C%22%24%24hashKey%22%3A%22object%3A347%22%7D%2C%7B%22label%22%3A%22FOOD%3AGREEK%22%2C%22id%22%3A%2218%22%2C%22%24%24hashKey%22%3A%22object%3A348%22%7D%2C%7B%22label%22%3A%22FOOD%3AINDIAN%22%2C%22id%22%3A%2224%22%2C%22%24%24hashKey%22%3A%22object%3A349%22%7D%2C%7B%22label%22%3A%22FOOD%3AITALIAN%22%2C%22id%22%3A%227%22%2C%22%24%24hashKey%22%3A%22object%3A350%22%7D%2C%7B%22label%22%3A%22FOOD%3ALATE%20NIGHT%22%2C%22id%22%3A%2247%22%2C%22%24%24hashKey%22%3A%22object%3A351%22%7D%2C%7B%22label%22%3A%22FOOD%3ALUNCH%22%2C%22id%22%3A%2227%22%2C%22%24%24hashKey%22%3A%22object%3A352%22%7D%2C%7B%22label%22%3A%22FOOD%3APIZZA%22%2C%22id%22%3A%225%22%2C%22%24%24hashKey%22%3A%22object%3A353%22%7D%2C%7B%22label%22%3A%22FOOD%3ASEAFOOD%22%2C%22id%22%3A%2244%22%2C%22%24%24hashKey%22%3A%22object%3A354%22%7D%2C%7B%22label%22%3A%22FOOD%3ASUSHI%22%2C%22id%22%3A%229%22%2C%22%24%24hashKey%22%3A%22object%3A355%22%7D%2C%7B%22label%22%3A%22FOOD%3ATHAI%22%2C%22id%22%3A%2211%22%2C%22%24%24hashKey%22%3A%22object%3A356%22%7D%2C%7B%22label%22%3A%22FOOD%3AVIETNAMESE%22%2C%22id%22%3A%228%22%2C%22%24%24hashKey%22%3A%22object%3A357%22%7D%2C%7B%22label%22%3A%22FOOD%3AWINGS%22%2C%22id%22%3A%2219%22%2C%22%24%24hashKey%22%3A%22object%3A358%22%7D%2C%7B%22label%22%3A%22HAPPY%20HOUR%3AHAPPY%20HOUR%22%2C%22id%22%3A%2242%22%2C%22%24%24hashKey%22%3A%22object%3A359%22%7D%5D%2C%22oldVal%22%3A%5B%7B%22label%22%3A%22DRINKS%3ABEER%22%2C%22id%22%3A%2250%22%2C%22%24%24hashKey%22%3A%22object%3A341%22%7D%2C%7B%22label%22%3A%22DRINKS%3ACOCKTAILS%22%2C%22id%22%3A%2257%22%2C%22%24%24hashKey%22%3A%22object%3A342%22%7D%2C%7B%22label%22%3A%22DRINKS%3AWINE%22%2C%22id%22%3A%2251%22%2C%22%24%24hashKey%22%3A%22object%3A343%22%7D%2C%7B%22label%22%3A%22FOOD%3AAPPETIZERS%22%2C%22id%22%3A%2220%22%2C%22%24%24hashKey%22%3A%22object%3A344%22%7D%2C%7B%22label%22%3A%22FOOD%3ABREAKFAST%22%2C%22id%22%3A%2228%22%2C%22%24%24hashKey%22%3A%22object%3A345%22%7D%2C%7B%22label%22%3A%22FOOD%3ABRUNCH%22%2C%22id%22%3A%2226%22%2C%22%24%24hashKey%22%3A%22object%3A346%22%7D%2C%7B%22label%22%3A%22FOOD%3ACHINESE%22%2C%22id%22%3A%226%22%2C%22%24%24hashKey%22%3A%22object%3A347%22%7D%2C%7B%22label%22%3A%22FOOD%3AGREEK%22%2C%22id%22%3A%2218%22%2C%22%24%24hashKey%22%3A%22object%3A348%22%7D%2C%7B%22label%22%3A%22FOOD%3AINDIAN%22%2C%22id%22%3A%2224%22%2C%22%24%24hashKey%22%3A%22object%3A349%22%7D%2C%7B%22label%22%3A%22FOOD%3AITALIAN%22%2C%22id%22%3A%227%22%2C%22%24%24hashKey%22%3A%22object%3A350%22%7D%2C%7B%22label%22%3A%22FOOD%3ALATE%20NIGHT%22%2C%22id%22%3A%2247%22%2C%22%24%24hashKey%22%3A%22object%3A351%22%7D%2C%7B%22label%22%3A%22FOOD%3ALUNCH%22%2C%22id%22%3A%2227%22%2C%22%24%24hashKey%22%3A%22object%3A352%22%7D%2C%7B%22label%22%3A%22FOOD%3APIZZA%22%2C%22id%22%3A%225%22%2C%22%24%24hashKey%22%3A%22object%3A353%22%7D%2C%7B%22label%22%3A%22FOOD%3ASEAFOOD%22%2C%22id%22%3A%2244%22%2C%22%24%24hashKey%22%3A%22object%3A354%22%7D%2C%7B%22label%22%3A%22FOOD%3ASUSHI%22%2C%22id%22%3A%229%22%2C%22%24%24hashKey%22%3A%22object%3A355%22%7D%2C%7B%22label%22%3A%22FOOD%3ATHAI%22%2C%22id%22%3A%2211%22%2C%22%24%24hashKey%22%3A%22object%3A356%22%7D%2C%7B%22label%22%3A%22FOOD%3AVIETNAMESE%22%2C%22id%22%3A%228%22%2C%22%24%24hashKey%22%3A%22object%3A357%22%7D%2C%7B%22label%22%3A%22FOOD%3AWINGS%22%2C%22id%22%3A%2219%22%2C%22%24%24hashKey%22%3A%22object%3A358%22%7D%2C%7B%22label%22%3A%22HAPPY%20HOUR%3AHAPPY%20HOUR%22%2C%22id%22%3A%2242%22%2C%22%24%24hashKey%22%3A%22object%3A359%22%7D%5D%7D%5D%2C%5B%7B%22msg%22%3A%22fn%3A%20function%20(c%2Cd%2Ce%2Cf)%7Be%3Da(c%2C%5Cr%5Cnd%2Ce%2Cf)%3Breturn%20b(e%2Cc%2Cd)%7D%22%2C%22newVal%22%3A%5B%7B%22label%22%3A%22DRINKS%3ABEER%22%2C%22id%22%3A%2250%22%2C%22%24%24hashKey%22%3A%22object%3A341%22%7D%2C%7B%22label%22%3A%22DRINKS%3ACOCKTAILS%22%2C%22id%22%3A%2257%22%2C%22%24%24hashKey%22%3A%22object%3A342%22%7D%2C%7B%22label%22%3A%22DRINKS%3AWINE%22%2C%22id%22%3A%2251%22%2C%22%24%24hashKey%22%3A%22object%3A343%22%7D%2C%7B%22label%22%3A%22FOOD%3AAPPETIZERS%22%2C%22id%22%3A%2220%22%2C%22%24%24hashKey%22%3A%22object%3A344%22%7D%2C%7B%22label%22%3A%22FOOD%3ABREAKFAST%22%2C%22id%22%3A%2228%22%2C%22%24%24hashKey%22%3A%22object%3A345%22%7D%2C%7B%22label%22%3A%22FOOD%3ABRUNCH%22%2C%22id%22%3A%2226%22%2C%22%24%24hashKey%22%3A%22object%3A346%22%7D%2C%7B%22label%22%3A%22FOOD%3ACHINESE%22%2C%22id%22%3A%226%22%2C%22%24%24hashKey%22%3A%22object%3A347%22%7D%2C%7B%22label%22%3A%22FOOD%3AGREEK%22%2C%22id%22%3A%2218%22%2C%22%24%24hashKey%22%3A%22object%3A348%22%7D%2C%7B%22label%22%3A%22FOOD%3AINDIAN%22%2C%22id%22%3A%2224%22%2C%22%24%24hashKey%22%3A%22object%3A349%22%7D%2C%7B%22label%22%3A%22FOOD%3AITALIAN%22%2C%22id%22%3A%227%22%2C%22%24%24hashKey%22%3A%22object%3A350%22%7D%2C%7B%22label%22%3A%22FOOD%3ALATE%20NIGHT%22%2C%22id%22%3A%2247%22%2C%22%24%24hashKey%22%3A%22object%3A351%22%7D%2C%7B%22label%22%3A%22FOOD%3ALUNCH%22%2C%22id%22%3A%2227%22%2C%22%24%24hashKey%22%3A%22object%3A352%22%7D%2C%7B%22label%22%3A%22FOOD%3APIZZA%22%2C%22id%22%3A%225%22%2C%22%24%24hashKey%22%3A%22object%3A353%22%7D%2C%7B%22label%22%3A%22FOOD%3ASEAFOOD%22%2C%22id%22%3A%2244%22%2C%22%24%24hashKey%22%3A%22object%3A354%22%7D%2C%7B%22label%22%3A%22FOOD%3ASUSHI%22%2C%22id%22%3A%229%22%2C%22%24%24hashKey%22%3A%22object%3A355%22%7D%2C%7B%22label%22%3A%22FOOD%3ATHAI%22%2C%22id%22%3A%2211%22%2C%22%24%24hashKey%22%3A%22object%3A356%22%7D%2C%7B%22label%22%3A%22FOOD%3AVIETNAMESE%22%2C%22id%22%3A%228%22%2C%22%24%24hashKey%22%3A%22object%3A357%22%7D%2C%7B%22label%22%3A%22FOOD%3AWINGS%22%2C%22id%22%3A%2219%22%2C%22%24%24hashKey%22%3A%22object%3A358%22%7D%2C%7B%22label%22%3A%22HAPPY%20HOUR%3AHAPPY%20HOUR%22%2C%22id%22%3A%2242%22%2C%22%24%24hashKey%22%3A%22object%3A359%22%7D%5D%2C%22oldVal%22%3A%5B%7B%22label%22%3A%22DRINKS%3ABEER%22%2C%22id%22%3A%2250%22%2C%22%24%24hashKey%22%3A%22object%3A341%22%7D%2C%7B%22label%22%3A%22DRINKS%3ACOCKTAILS%22%2C%22id%22%3A%2257%22%2C%22%24%24hashKey%22%3A%22object%3A342%22%7D%2C%7B%22label%22%3A%22DRINKS%3AWINE%22%2C%22id%22%3A%2251%22%2C%22%24%24hashKey%22%3A%22object%3A343%22%7D%2C%7B%22label%22%3A%22FOOD%3AAPPETIZERS%22%2C%22id%22%3A%2220%22%2C%22%24%24hashKey%22%3A%22object%3A344%22%7D%2C%7B%22label%22%3A%22FOOD%3ABREAKFAST%22%2C%22id%22%3A%2228%22%2C%22%24%24hashKey%22%3A%22object%3A345%22%7D%2C%7B%22label%22%3A%22FOOD%3ABRUNCH%22%2C%22id%22%3A%2226%22%2C%22%24%24hashKey%22%3A%22object%3A346%22%7D%2C%7B%22label%22%3A%22FOOD%3ACHINESE%22%2C%22id%22%3A%226%22%2C%22%24%24hashKey%22%3A%22object%3A347%22%7D%2C%7B%22label%22%3A%22FOOD%3AGREEK%22%2C%22id%22%3A%2218%22%2C%22%24%24hashKey%22%3A%22object%3A348%22%7D%2C%7B%22label%22%3A%22FOOD%3AINDIAN%22%2C%22id%22%3A%2224%22%2C%22%24%24hashKey%22%3A%22object%3A349%22%7D%2C%7B%22label%22%3A%22FOOD%3AITALIAN%22%2C%22id%22%3A%227%22%2C%22%24%24hashKey%22%3A%22object%3A350%22%7D%2C%7B%22label%22%3A%22FOOD%3ALATE%20NIGHT%22%2C%22id%22%3A%2247%22%2C%22%24%24hashKey%22%3A%22object%3A351%22%7D%2C%7B%22label%22%3A%22FOOD%3ALUNCH%22%2C%22id%22%3A%2227%22%2C%22%24%24hashKey%22%3A%22object%3A352%22%7D%2C%7B%22label%22%3A%22FOOD%3APIZZA%22%2C%22id%22%3A%225%22%2C%22%24%24hashKey%22%3A%22object%3A353%22%7D%2C%7B%22label%22%3A%22FOOD%3ASEAFOOD%22%2C%22id%22%3A%2244%22%2C%22%24%24hashKey%22%3A%22object%3A354%22%7D%2C%7B%22label%22%3A%22FOOD%3ASUSHI%22%2C%22id%22%3A%229%22%2C%22%24%24hashKey%22%3A%22object%3A355%22%7D%2C%7B%22label%22%3A%22FOOD%3ATHAI%22%2C%22id%22%3A%2211%22%2C%22%24%24hashKey%22%3A%22object%3A356%22%7D%2C%7B%22label%22%3A%22FOOD%3AVIETNAMESE%22%2C%22id%22%3A%228%22%2C%22%24%24hashKey%22%3A%22object%3A357%22%7D%2C%7B%22label%22%3A%22FOOD%3AWINGS%22%2C%22id%22%3A%2219%22%2C%22%24%24hashKey%22%3A%22object%3A358%22%7D%2C%7B%22label%22%3A%22HAPPY%20HOUR%3AHAPPY%20HOUR%22%2C%22id%22%3A%2242%22%2C%22%24%24hashKey%22%3A%22object%3A359%22%7D%5D%7D%5D%5D at angularjs.js:6 at n.$digest (angularjs.js:131) at n.$apply (angularjs.js:133) at HTMLDocument.<anonymous> (multipledropdown.js:1) […]

AngularJS Sorting for multiple ng-repeats

I am working on creating a schedule for which we have created a JSON like following { “cancelledWeeks”: { “1511548200”: [ { “match_id”: “e06d20944182aa2b5ead43e8990e5985”, “reason”: “chhj”, “round”: 1, “team1”: “team_id_17101711595974”, “team1_captains”: { }, “team1_color_code”: “#1f1818”, “team1_name”: “17October team”, “team2”: “team_id_1710179490074”, “team2_captains”: { }, “team2_color_code”: “#302929”, “team2_name”: “cms team 4”, “time”: “6:30 PM” }, { “match_id”: “4715cf8897663e5474feaa14ef396674”, “reason”: “chhj”, “round”: 1, “team1”: “team_id_17101712185745”, “team1_captains”: { }, “team1_color_code”: “#1f0606”, “team1_name”: “october 19”, “team2”: “team_id_1710179420033”, “team2_captains”: { }, […]

Angularjs: How to order an array based on a child array of object’s Date field

I’ve got an array of arrays of objects that has the following structure: parentArr = [ [{id:1, date:1505020200000}, {id:4, date:1505020200000 }], [{id:2, date:1504681500000}], [{id:3, date:1504671000000}, {id:20, date:1504671000000}] ] Each child array will only contain dates that are the same. What I’m trying to do is use angular’s orderBy filter to to order the dates from oldest to newest, but I’m unsure of how to do it. I’ve tried setting the orderby filter to a variable […]