angularweb-storage

How to update ngx-webstorage key value?


I have a component that calls webstorage and retrieves an instance of key-value store. On update, the stored item is not being changed.

@Component({
  templateUrl: 'accomodation.component.html',
 providers: [ItemService]
})
export class AccomodationComponent implements OnInit {
  selectedItem = new Item();              
  constructor(private warehouse: Warehouse) {   
  }

  ngOnInit() {

  }   

  storeData(selectedItem: Item) {
    this.warehouse.set('item',selectedItem);
  }

  updateData(updatedItem: Item) {
    this.warehouse.set('item',updatedItem);
  }

}

Solution

  • The ngx-warehouse api is working well, It was the problem with Google Chrome which was not refreshing indexedDB storage, After hours of debugging i tried mozilla and saw that it was working like charm.