Advance tutorial Angular sorting data sorting of id, age, name ascending descending order angular 9

preview_player
Показать описание
Sorting of data ascending and descending order sorting age , name, id in angular 9
getting data from get api got response in one variable then sort that data
Рекомендации по теме
Комментарии
Автор

thanks bro ! your video solved my problem ! lot of love and thanks to u

shankarsamota
Автор

what kind of namespace or import used for this.order and this.isdesc?

padmapriya
Автор

great nice video thanks for explaination

georgequalwebs
Автор

reverse = true;
/*declare one variable */
employees = [
{id : 8, name : 'Sachin', position :'UI Developer'},
{id : 4, name : 'Virat', position :'Youtuber'},
{id : 10, name : 'Rohit', position :'Designer'},
]
/* bind this sort function to id column*/
sortData() {
if(this.reverse) {
this.newArray = this.employees.sort((a:any, b:any)=> b.id - a.id)
this.reverse = !this.reverse;
}
else if(!this.reverse){
this.newArray = this.employees.sort((a:any, b:any)=> a.id - b.id)
this.reverse = !this.reverse
}
}
simple example of column sorting

kishorphawade
Автор

Hi Gaurav,
for me I am getting this error
Cannot assign to read only property '0' of object '[object Array]', Can you advice...

prashanthjangili
Автор

why the name isDesc?? the variables name are a little confusing

rayanearaujo
Автор

Nicely done and explained...can I get the source code?

DeepakPrajapati
Автор

How can filter range Wise 10 to 15 id value

jyotiraghu
Автор

hello, can you pls share me this code?

estebancandioti