PillowPillow / ng2-webstorage

Localstorage and sessionstorage manager - Angular service
MIT License
428 stars 91 forks source link

Can't access children object saved in SessionStorage (Decorator) #113

Closed Haytam95 closed 5 years ago

Haytam95 commented 5 years ago

Versions:

Describe the bug

I have an object called 'CurrentJuegoDatos', it has some primitive properties and then some objects (imagenDeFondo and usuarioCreador).

When i try to access those objects, returns 'undefined'. But, when i use JSON.stringify(this.currentJuegoDatos), or access parent object i can see the values in the Json.

To Reproduce

  1. Generate two classes, one must be inside another.
  2. Set the value using decorators
  3. Try to access the property from another component.

Expected behavior

Access to childrens of an object stored in local storage // session storage.

Screenshots

Browser sessionStorage

image


Access from property with decorator SessionStorage (juegoDatosActual)

image


BUG access to property children

image

Desktop (please complete the following information):

Extra context

Here is the definition of the class "JuegoDatos"

image

Thanks for help me out and sorry for bad english

Haytam95 commented 5 years ago

Update:

Aparently, i can access inside the "User" property, but not the "imagenFondo" property. The only difference i can see between them, is that imagenFondo has a "Date" attribute. I don't know if that help.

image

Haytam95 commented 5 years ago

Excuse me... I didn't see the misname. I just re-checked the code all way long, read again the issue and found the bug.

imagenFondo is defined in the DTO name, and the server is returning me imagenDeFondo property.