iron-localstorage not working

324 views
Skip to first unread message

Sathish Kumar

unread,
Aug 5, 2015, 3:09:00 PM8/5/15
to Polymer
Hi,

i tried polymer1.0 docs iron-localstorage example but its not working any please help me.

i have attached files my files for reference

Thanks
Sathish
index.html
ls-sample.html

Kyle Maxwell

unread,
Aug 5, 2015, 8:28:21 PM8/5/15
to Polymer
Can you specify what is not working? Describe the actual results and the expected results.
From what I can guess based on your code, it looks like you have the functions mixed up. I would expect
on-iron-localstorage-load-empty="makeModifications"
to be the following instead
on-iron-localstorage-load-empty="initializeDefaultCartoon"
That way when local storage is empty it would call initializeDefaultCartoon after the ready() lifecycle callback. Then you can call makeModifications later, and the value should be persisted.
-kyle (Random Polymer User)

Kyle Maxwell

unread,
Aug 5, 2015, 8:30:58 PM8/5/15
to Polymer
Also, just realized, this might be the kind of question to move to stack-overflow (I just saw the other thread about that).
-kyle

Sathish Kumar

unread,
Aug 6, 2015, 1:44:27 AM8/6/15
to Polymer
Hi Kyle,

i tried that change too still data not stored in localstorage.
Reply all
Reply to author
Forward
0 new messages