After receiving my $http response, the data is presented in the format below:
$scope.rooms = {
'2B' : [
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ebd9a9c6d8d9d8ab868ec5888486">[email protected]</a>","RoomName":"2B-323"},
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ccfe8ee1fdfeff8ca1a9e2afa3a1">[email protected]</a>","RoomName":"2B-123"}
],
'5A' : [
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="86b3c7abb5b4b5c6ebe3a8e5e9eb">[email protected]</a>","RoomName":"5A-323"},
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="754034584447463518105b161a18">[email protected]</a>","RoomName":"5A-123"},
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f1c4b0dcc5c3c2b19c94df929e9c">[email protected]</a>","RoomName":"5A-423"}
],
'1A' : [
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9faedeb2acadacdff2fab1fcf0f2">[email protected]</a>","RoomName":"1A-323"},
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dbea9af6eae9e89bb6bef5b8b4b6">[email protected]</a>","RoomName":"1A-123"},
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a796e68a939594e7cac289c4c8ca">[email protected]</a>","RoomName":"1A-423"}
]
}
To arrange this data in a specific order as shown below:
$scope.rooms = {
'1A' : [
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0d3c4c203c3f3e4d6068236e6260">[email protected]</a>","RoomName":"1A-123"},
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4a7b0b677978790a272f64292527">[email protected]</a>","RoomName":"1A-323"},
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="deef9ff3eaeced9eb3bbf0bdb1b3">[email protected]</a>","RoomName":"1A-423"}
],
'2B' : [
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ab99e9869a9998ebc6ce85c8c4c6">[email protected]</a>","RoomName":"2B-123"},
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c8fa8ae5fbfafb88a5ade6aba7a5">[email protected]</a>","RoomName":"2B-323"}
],
'5A' : [
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a194e08c909392e1ccc48fc2cecc">[email protected]</a>","RoomName":"5A-123"},
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aa9feb87999899eac7cf84c9c5c7">[email protected]</a>","RoomName":"5A-323"},
{"RoomEmailId":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="380d79150c0a0b78555d165b5755">[email protected]</a>","RoomName":"5A-423"}
],
}
I am looking for guidance on how to implement this sorting using JavaScript.