G
G
Galdar Turin2020-06-05 14:32:21
Angular
Galdar Turin, 2020-06-05 14:32:21

How to filter the list alphabetically?

There is an array with objects and it is required to display it alphabetically.

spoiler
[
{"ID":231,"NAME":"Francesca","LAST_NAME":"Shields","TYPE_ID":"CLIENT","PHONE":[{"ID":4,"VALUE_TYPE":"MOBILE","VALUE":"+7 (869) 482-3146","TYPE_ID":"PHONE"}]},
{"ID":394,"NAME":"Valerie","LAST_NAME":"Mclean","TYPE_ID":3,"PHONE":[{"ID":9,"VALUE_TYPE":"MOBILE","VALUE":"+7 (814) 421-3127","TYPE_ID":"PHONE"}]},
{"ID":242,"NAME":"Wiggins","LAST_NAME":"Mason","TYPE_ID":null,"PHONE":[{"ID":9,"VALUE_TYPE":"MOBILE","VALUE":"+7 (974) 518-3851","TYPE_ID":"PHONE"}]},
{"ID":354,"NAME":"Meyers","LAST_NAME":"Olsen","TYPE_ID":3,"PHONE":[{"ID":5,"VALUE_TYPE":"MOBILE","VALUE":"+7 (999) 421-2134","TYPE_ID":"PHONE"}]},
{"ID":493,"NAME":"Kaitlin","LAST_NAME":"Nguyen","TYPE_ID":"PARTNER","PHONE":[{"ID":4,"VALUE_TYPE":"MOBILE","VALUE":"+7 (861) 526-2655","TYPE_ID":"PHONE"}]},
{"ID":119,"NAME":"Eve","LAST_NAME":"Montgomery","TYPE_ID":"SUPPLIER","PHONE":[{"ID":5,"VALUE_TYPE":"MOBILE","VALUE":"+7 (816) 453-3396","TYPE_ID":"PHONE"}]},
{"ID":459,"NAME":"Shelley","LAST_NAME":"Fitzgerald","TYPE_ID":"SHARE","PHONE":[{"ID":3,"VALUE_TYPE":"MOBILE","VALUE":"+7 (892) 450-3003","TYPE_ID":"PHONE"}]},
{"ID":115,"NAME":"Stephenson","LAST_NAME":"Crosby","TYPE_ID":1,"PHONE":[{"ID":4,"VALUE_TYPE":"MOBILE","VALUE":"+7 (821) 563-3988","TYPE_ID":"PHONE"}]},
{"ID":326,"NAME":"Malinda","LAST_NAME":"Gaines","TYPE_ID":"SUPPLIER","PHONE":[{"ID":3,"VALUE_TYPE":"MOBILE","VALUE":"+7 (964) 598-3959","TYPE_ID":"PHONE"}]},
{"ID":148,"NAME":"Parks","LAST_NAME":"Holloway","TYPE_ID":4,"PHONE":[{"ID":6,"VALUE_TYPE":"MOBILE","VALUE":"+7 (918) 468-2808","TYPE_ID":"PHONE"}]},
{"ID":475,"NAME":"Valencia","LAST_NAME":"Sutton","TYPE_ID":3,"PHONE":[{"ID":1,"VALUE_TYPE":"MOBILE","VALUE":"+7 (960) 476-3349","TYPE_ID":"PHONE"}]},
{"ID":253,"NAME":"Penny","LAST_NAME":"Bennett","TYPE_ID":"JOURNALIST","PHONE":[{"ID":7,"VALUE_TYPE":"MOBILE","VALUE":"+7 (866) 522-3704","TYPE_ID":"PHONE"}]},
{"ID":149,"NAME":"Margery","LAST_NAME":"Heath","TYPE_ID":"SHARE","PHONE":[{"ID":1,"VALUE_TYPE":"MOBILE","VALUE":"+7 (822) 494-2255","TYPE_ID":"PHONE"}]},
{"ID":309,"NAME":"Marshall","LAST_NAME":"Lester","TYPE_ID":2,"PHONE":[{"ID":10,"VALUE_TYPE":"MOBILE","VALUE":"+7 (971) 420-3694","TYPE_ID":"PHONE"}]}
]

I output via *ngFor, I can do it via pipe. Who can advise.
Filter naturally by name!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Galdar Turin, 2020-06-05
@Galdar

How to sort an array of objects alphabetically?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question