title: Getting error while adding value to indexedDB using angular2
body: <p>I am using IndexedDB using Angular2. For that i am following the below github link. <a href="https://github.com/gilf/angular2-indexeddb" rel="nofollow noreferrer">https://github.com/gilf/angular2-indexeddb</a></p>
  
  <p>I am creating db like this and adding value like this.</p>
  
  <pre><code>    ngOnInit(){
  
          let db = new AngularIndexedDB('mydb', 1);
          db.createStore(1, (evt) =&gt; {
              let objectStore = evt.currentTarget.result.createObjectStore(
                  'Userdetails', { keyPath: "id", autoIncrement: true });
  
              objectStore.createIndex("name", "name", { unique: false });
              objectStore.createIndex("email", "email", { unique: true });
  
          });
  
  
  db.add('Userdetails', { name: 'name', email: 'name@mail.com' }).then(() =&gt; {
      // Do something after the value was added
       console.log('fields added');
  }, (error) =&gt; {
      console.log('error is'+error);
  });
  
  }
  </code></pre>
  
  <p>But in console i am getting error like this.<strong>You need to use the createStore function to create a database before you query it!</strong></p>
  
  <p>Can anyone please tell me where exactly i am doing wrong.I am very new to this angular2-indexeddb.Please help me.</p>