Building out your app, "lists is not defined" localStorage error


Hello all… I’m running through the tutorial and have renamed some of the stuff from the tutorial to my liking, but believe I am still doing everything correctly… except window.localStorage[‘lists’] on line 31 seems to be working. It doesn’t create the ‘lists’ localStorage item, and it goes on undefined, breaking the app.

The bug is currently live on my Github repo:

The file(s) in question are here:

How do I properly hook up the window.localStorage[‘lists’]? Am I doing something wrong or have I simply written something incorrectly?

Thanks for the help :smile:

save: function () {
      window.localStorage['lists'] = angular.toJson(lists);


maybe should pass the list in the save-function.

and please use the localstorage methods like getItem, setItem and removeItem to work with the local storage


Ah, yes! That’s what was missing, as well as a few other things. Thank you

The commit changes are here as a reference for anyone else stuck with the same issue…

Also, as for now was just following the tutorial… but will definitely look into the getItem, setItem and removeItem stuff (I believe here it is already written about??