So, I am trying to create a sorting list in the Attributes. Once a person clicks the name of the value, it updates the dom and displays the data accordingly. Bracelets, charms, and so on ... I know that I can do something like this:
But this is just an object I have several objects coming from the server. Here is my category object:
{"Pandora": {"id": "1", "s1": {"d1" "cube", " "D6": "Jewelry", "D5": "Pendant", "D7": "Bracelet", "D2": "Cheams", "D3": "Earrings", "D4": " Necklace "," D6 "rings"}}}
I'm reading that you can not use an order of angles without the array of objects. I have this code in my controller:
$ scope.catData = [];
Then I have a factory which The server goes on to catch json
dataFactory.getCat (). Then (function (res) {$ scope .catData = res.data;});
here My code looks like
& lt; li ng-repeat = "catData" (key, value) & gt; & lt; a href = "#" data-id = '{ {Value.id}} 'class = "anchor" & gt; {{key}} gt; & lt; ul class = "sub" ng-class = "{true:' active slides'} [Value.id == 1] "& gt; & lt; span ng- repeat =" hi value.s1 " I & gt; {{Hi}} & lt; / a & gt; & lt; / li & gt; & lt; / span & gt; & lt; / ul & gt; & lt; / li & gt; / Code> I'm thinking that when I set $ scope.catData in an array, then set $ scope.catData = res.data Override I can set the $ scope.catData = [res.data]
but I do not think it's the right way to do it (or maybe?).
< P> Thanks ng click and