Hi,
I want to store an array of object called edition
export class Edition {
title:string;
author:string;
summary:string;
constructor...
}
i use the storage https://ionicframework.com/docs/storage/
So in my code i have
editions is an array of Editions, declared as
editions: Edition[];
When i want to store i use this method
console.log(this.editions);
this.storage.set("editions", this.editions);
In another function i want to read it later so i wrote this:
this.storage.get("editions").then( (value) => {
editions: Edition[];
if(value)
editions = value;
console.log(editons);
});
When i look the console. before the set, types in array are Edition objects but in the get they are Object objects. So when later i want to use in a indexOf to find if a certain value exist it fails.
How can i have the right type during the get Process.
(I have also tried using JSON.stringify and JSON.parse function but i have the same result)