I'm a student and new to Angular, so I apologize if this is obvious.
I see Angular used frequently for displaying lots of data. From what I've seen, it works fantastically when your data is stored as an array, but only puts up a fight when you try to use it with an associative array (Possible, but requires work-arounds).
Scenario:
I've got an array of kittens:
var kittens = [
{
id: "id0",
breed: "persian",
name: "Mr. Cuddles"
},
{
id: "id1",
breed: "siamese",
name: "Puddin' Face"
},
{
id: "id2",
breed: "ragamuffin",
name: "Rumblemuffins"
}
];
And there are a lot of kittens. I have an angular factory kittenService that retrieves this data from an API and maintains this array. I need the ability to look up these kittens by id and filter by breed. I turned this into an associative array with id as the key, but then I run into issues with $filter, etc. There isn't as much documentation for associative arrays, and it all seems just easier to implement using regular arrays.
tl;dr
If AngularJS is used to act on data, Why are associative arrays not as common in AngularJS applications? Should I think differently about data storage when using Angular?
kittens["id0"](if I wrotekittensas an associative array) would be equivalent to kittens.id0 (if I were to rewritekittensas an object)?