Hello.
I have an array in type of:
itemList = [{
name: ‘One’,
category: ‘cat’,
id: ‘5’
},
{
name: ‘Apple’,
category: ‘cat’,
id: ‘6’
}];
And i’m trying to sort the items alphabetic by the name. I use ngFor to display them all inside the html template. Is there a way to sort the array alphabetic in the typescript or html file? I tried some things that I found but most of them where outdated and didn’t work anymore.
Thanks in advance for the help!
Edit 1: Forget the brackets.