title: add value in IndexedDB using Angular 7
body: <p>Firstly, I tried all the questions &amp; answers related to this topic. Additionally and I tried related questions and try to solve it but no success. So please read my question thoroughly.</p>
  
  <p><strong><em>Prefer Links</em></strong></p>
  
  <p><a href="https://www.npmjs.com/package/ngx-indexed-db" rel="nofollow noreferrer">ngx-indexed-db</a></p>
  
  <p><strong><em>Search related to Links</em></strong> </p>
  
  <p><a href="https://stackoverflow.com/questions/44406173/getting-error-while-adding-value-to-indexeddb-using-angular2">Getting error while adding value to indexedDB using angular2</a></p>
  
  <p>I want to add data in <strong><code>indexeddb</code></strong> but somehow database connection open error is display. I have attached a screenshot.so I request put on answer one small example add value in <strong><code>indexeddb</code></strong>.
  <a href="https://i.stack.imgur.com/UJZQY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UJZQY.png" alt="enter image description here"></a></p>
  
  <p><strong>My code</strong> </p>
  
  <p><strong><em><code>app.components.js</code></em></strong></p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { NgxIndexedDB } from 'ngx-indexed-db';
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent implements OnInit {
    title = 'indexDb-Angular';
  
  
    ngOnInit() {
      let  db = new NgxIndexedDB('DVdb', 1);
      db.openDatabase(1, evt =&gt; {
        let objectStore = evt.currentTarget.result.createObjectStore('people', { keyPath: 'id', autoIncrement: true });
  
        objectStore.createIndex('name', 'name', { unique: false });
        objectStore.createIndex('email', 'email', { unique: true });
  
      });
  
      db.add('people', { name: 'Sumit', email: 'Sumit@test.com' }).then(
        () =&gt; {
            // Do something after the value was added
        },
        error =&gt; {
            console.log(error);
        }
    );
    }
  
  }
  </code></pre>