I need assistance with sorting a list of items alphabetically by name and displaying them on the page. The issue I am facing is that some of the names contain numbers like
var items = [
{‘name’ : ‘name 1’},
{‘name’ : ‘name 2’},
{‘name’ : ‘name 3’},
…more
{‘name’ : ‘name 11’},
{‘name’ : ‘name 12’},
{‘name’ : ‘name 21’},
{‘name’ : ‘name 22’}
]
Html
<div ng-repeat=“item in items | orderBy: ‘name’”>
<h3> {{item.name}}</h3>
</div>
The current output looks like
name 1
name 11
name 12
name 2
name 21
name 22
My desired result is
name 1
name 2
name 3
name 11
name 12
name 21
name 22
If there is a quick solution to achieve this, I would appreciate any help. Thank you!