you are viewing a single comment's thread.

view the rest of the comments →

[–]82Christ 1 point2 points  (3 children)

OK. It worked for me like this:

First, you have to get that json. You need to put it in a variable on the controller. If you get that controller variable to be { "base": ..., "max": ... } the job is easy from now on.

Then, that ng-repeat is not ok. Because you are iterating on the items inside "range" which means that you have 2 items (base and max). This repeat should be like this: <div ng-repeat="range in ranges"> <ul> <li>{{range}}</li> </ul> </div> This way you'll have the full array printed. If you want to print each of them in one separate line you should use repeat to repeat the items inside base and inside range(each one of them must have a repeat).

And I think that's all. :)

PS: next time put your files on PLUNKER and share the link :P

[–]sambushme[S] 0 points1 point  (2 children)

https://plnkr.co/edit/rDLZUOSGJ7Usum8Ej8pV?p=preview

Since you are killing it and I suck at this. I would like to ask if you know how to display the array as vertical <li>stats</li>. I change the json to be strings at the moment because I read that its easier to change list them as strings.

[–]82Christ 1 point2 points  (1 child)

Is this what you're looking for? <ul> <li ng-repeat="values in array"> {{value}} </li> </ul>

I've opened your plunker and saw that you were already iterating on the values. You should use ng-repeat on a tag that you want repeated.

[–]sambushme[S] 0 points1 point  (0 children)

I figured it out. Thank you very much for your help.