How can save array in native storage


#1

my code

   this.nativeStorage.setItem('item', { service_id: item.id, count_order: this.count_order })
      .then(
      () => alert("ok"),
      error => alert(error)
      );

#2

And this doesn’t work?
If setItem only accepts strings, JSON.stringify is your friend.

Also, is there a reason why you use NativeStorage instead of just Ionic Storage?


#3

Additionally, I’m not seeing any arrays here.


#4

Probably another poor developer that was raised on PHP as I was :wink: :stuck_out_tongue: