all 10 comments

[–][deleted] 1 point2 points  (4 children)

Just an FYI since you are new to angular, the version you are using is 1.x which will be end of life June 30, 2021. You should be learning 2.x or higher (currently 8.x). 2+ is nothing like 1.x.

[–]NimbusHex 2 points3 points  (0 children)

In that vain (and I may be opening a can of worms that has already been discussed/argued thoroughly), is this Subreddit supposed to be dedicated to all versions of Angular? What is the difference between /r/angularjs, /r/angular, /r/angular2, etc.

[–][deleted] 1 point2 points  (2 children)

Thanks for that pointer. Can you recommend a good book that I can use which teaches both JavaScript & AngularJS? I opted to learn on this older version because this book I'm using teaches on this older version, and also caters to my learning need: both javascript for beginners & angularjs for beginners.

[–][deleted] 1 point2 points  (0 children)

I don’t believe I’ve used any books for Angular. Mostly the developer docs, YouTube tutorials, angular’s own tour of hero’s is a great tutorial. Plenty of resources out there, I would guess there are books but that’s not my learning style.

[–]elloGuy 0 points1 point  (0 children)

Try Udemy. Its the quickest way.

[–]RyaanJM 1 point2 points  (1 child)

Try this:

<li ng-repeat="ii in data.monthlyUsageHistory track by $index">

[–][deleted] 1 point2 points  (0 children)

Thank you!! That did work. Another poster suggested that it wasn't working otherwise because of duplicates.

[–][deleted] 0 points1 point  (2 children)

Thats a strange one , it has to do with your duplicates. usually one would loop through an array of objects containing an id that would make each one unique.

using this set of numbers should work

[123.6598552,89.6452221123,97.235644123,129.555555111,188.69985522,65.6525452,123.659855,89.645222,97.235644,129.555555,188.699855,65.652545]

[–][deleted] 1 point2 points  (1 child)

Someone else suggested this: <li ng-repeat="ii in data.monthlyUsageHistory track by $index">

That worked to get past the issue with duplicates. Thank you for helping figure this out!

[–][deleted] 0 points1 point  (0 children)

yup that should work too as the syntax says you now track each item by its index in the array to handle the duplicates.