Hi, I’m trying to save fav on account/ page and to display from different pages.
In dynamic page read.html I have this:
public itemBookmark = [];
bookmarkSave()
{
this.itemBookmark.push(this.url);
this.nativeStorage.setItem('bookmark',
{
itemBookmarked: this.itemBookmark
})
.then(
() => {
alert("Saved on bookmark");
},
error =>
{
console.log('Error storing item')
}
);
}
and in account.html
bookmark: any;
ionViewWillEnter()
{
this.nativeStorage.getItem('bookmark')
.then(
data =>
{
this.bookmark = {itemBookmarked: data.itemBookmarked};
alert(data.itemBookmarked)
},
error =>
{
//
}
);
}
the problem is that it works only with 1 bookmark. Every time I try to bookmark other item it replaces the existing one.
I also tried to inside account.html to getItem(‘bookmark’) and it it exists to push another item but It didn’t work.
Do you have any ideas how to save more items inside 1 storage?
Thank you!