var Error-dictionary = [
{
code:599,
MSG:'unknown'
},
{
code:404,
MSG:'not found'
},
{
code:599,
MSG:'unknown'
}
]
I would like to transform the data structure into something similar to:
[
{
code : 599,
count:2,
MSG : 'unknown',
code :404,
count:1,
MSG : 'not found'
}
]
and then add it to $scope.alerts
as a message.
The error codes and messages can vary dynamically.