Questions tagged indexeddb

Explore the latest questions and answers asked by our top developers.

angular load data in component only when indexedDb table is populated

In my service I have this: synchronizeCitiesOnLogin() { …. this.getCitiesFromApi().subscribe( cities => { cities.map((city) => { this.addCityToIndexedDb(city); }); } ); } getCitiesFromApi() { …. return this.apiClient.get(url, { }) .pipe( map((response: any) => response.data ), catchError(errorRes => { return throwError(errorRes); }) ); } addCitiesToIndexedDb(city) { this.cityTable .add(city) .then(async () => { const allItems: CityModel[] = await […]

By godzo101
Published
Categorized as angular, indexeddb, javascript Tagged , ,

retrieve datas from indexedDB angular

I am currently working on a PWA project. I use indexedDB for storing data in the browser cache when the internet network is unavailable. I want to retrieve this data and send it to the database server when the internet connection is restored. I’ve been looking for a long time but I don’t know how […]

By olivier
Published
Categorized as angular, indexeddb Tagged ,

Angular indexedDB : send data from indexedDb to my database server

I try to design a small application where a user transmits data to the server via a form. This mechanism must work even in the absence of a network.so I relied on the PWA model. Initially, I wanted to use localstorage api to store the data on my browser cache, but for memory reasons it […]

By olivier
Published
Categorized as angular, database, indexeddb Tagged , ,

Unable to delete field from indexeddb uisng primay key as id

I am trying to delete a record form indexeddb and in service I have created a function to delete by primary key: id . Field is not getting deleted. Also I am getting a warning as Unhandled rejection: TypeError: Invalid key provided. Keys must be of type string, number, Date or Array<string | number | […]

By NoobCoder
Published
Categorized as angular, dexie, indexeddb, typescript Tagged , , ,

Unable to delete field from IndexedDB using primary key as id

I am trying to delete a record form indexeddb and in service I have created a function to delete by primary key: id . Field is not getting deleted. Also I am getting a warning as Unhandled rejection: TypeError: Invalid key provided. Keys must be of type string, number, Date or Array<string | number | […]

By NoobCoder
Published
Categorized as angular, dexie, indexeddb, typescript Tagged , , ,

How to delete single field from indexeddb using dexie and angular by passsing key dynamically

I am trying to delete by key of a field from indexedDb which I am adding but unable to do so yet. I have to pass hard code key value but I want to pass key dynamically to the delete function. I am using Angular PWA app and Dexie.js library to do operation as going […]

How to add multiple objects in single key using indexedDb and angular

I am adding data into indexedDb using angular service. Here I am using .put() method to add/ update data on a single key. When I am using .add() method it is throwing DOMException: Key already exists in the object store error for obvious single key. So, how can I add multiple objects on a single […]

IndexedDb returning [object object] when trying to get data

I am trying to solve an issue where IndexedDb is returning [object object] when defining the ‘key’. function getData(db) { const transaction = db.transaction([‘user-store’]); const objectStore = transaction.objectStore(‘user-store’); const request = objectStore.get(‘userDetail’); <======= [object object] request.onerror = (event) => { // Handle errors! }; request.onsuccess = (event) => { // Do something with the request.result! […]

How to define custom object (table) in Indexed DB?

I want to define custom structure in my Indexed DB. how i can define document structure in Indexed DB. let’ say I have one people class export class People { id : number name: string lists: LookUp[] constuctor() { } } and LookUp class is export class LookUp { id: number name: string constuctor() { […]

Storing Form-Data into indexed db in angular

The below code is what i have done component.ts onSubmit() { var postData = new FormData(); postData.append(‘id’, this.post.id); postData.append(‘title’, this.post.title); postData.append(‘location’, this.post.location); postData.append(‘file’, this.picture, this.post.id + ‘.png’); this._indexedDBService.addPost(postData) } service.ts export class IndexedDBService { db: any; constructor() { this.connectToDb() } async connectToDb() { this.db = await openDB<MyDB>(‘posts-store’, 1, { upgrade(db) { if (!db.objectStoreNames.contains(‘sync-posts’)) { db.createObjectStore(‘sync-posts’, […]

By Rushikesh Gadekar
Published
Categorized as angular, indexeddb Tagged ,
1 2

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq