title: ionic 3 with storage
body: <p>I am using ionic 3 with storage.</p>
  
  <p>First, i import storage in the app.module.ts</p>
  
  <pre><code>import { IonicStorageModule } from '@ionic/storage';
  
  imports: [
  IonicStorageModule.forRoot()
  ]
  </code></pre>
  
  <p>I developed Ecommerce app.If I add to any product to cart using storage.</p>
  
  <p>Here is my code for Cart page.</p>
  
  <pre><code>   &lt;ion-row class="apply-coupon" *ngFor="let p of Cartproducts;let i=index"&gt;
  &lt;ion-col col-4&gt;
  &lt;img src="{{p.P_IMAGES[0].URL}}" alt="product2"&gt;
  &lt;/ion-col&gt;
  &lt;ion-col col-8&gt;
  &lt;h1&gt;{{p.P_TITLE}}&lt;/h1&gt;
  &lt;p class="subtitle"&gt;Subtitle&lt;/p&gt;
  &lt;p class="code"&gt;Code: 123&lt;/p&gt;
  &lt;div&gt;
  &lt;button (click)="cancel(i)"&gt;Cancel X&lt;/button&gt;
  &lt;/div&gt;
  &lt;/ion-col&gt;  
  &lt;/ion-row&gt;
  
   this.items.push(item);
   this.storage.set('products',this.items);
  </code></pre>
  
  <p>item is a product detail.and I have displayed the cart count.</p>
  
  <pre><code>this.storage.get('products').then((data) =&gt; {
       if(data != null)
       {
         this.Cartproducts=data;
         console.log(this.Cartproducts);
  
       }
      });
  </code></pre>
  
  <p>here is my consoled value.</p>
  
  <pre><code>   [
      {
          'Product_title':'Product name',
          'Product desc':'product dec',
          'id':1
      },
      {
          'Product_title':'Product name',
          'Product desc':'product dec'
          'id':2
      }
  ]
  </code></pre>
  
  <p>If I need to remove the last product.</p>
  
  <pre><code> this.Cartproducts.splice(i, 1);
   console.log(this.Cartproducts);
   this.storage.remove('products');
   this.storage.set('products',this.Cartproducts);
  </code></pre>
  
  <p>Here is my consoled value.</p>
  
  <pre><code>[
      {
          'Product_title':'Product name',
          'Product desc':'product dec',
          'id':1
      }
  ]
  </code></pre>
  
  <p>I remove the storage value in <code>'products'</code> Again I set the value <code>products</code></p>
  
  <p>I I need another product.so I am going to the product page and add the product.</p>
  
  <p>But my result is </p>
  
  <pre><code>[
      {
          'Product_title':'Product name',
          'Product desc':'product dec',
          'id':1
      },
      {
          'Product_title':'Product name',
          'Product desc':'product dec'
          'id':2
      },
      {
          'Product_title':'Product name',
          'Product desc':'product dec'
          'id':3
      }
  ]
  </code></pre>
  
  <p>But Actually, I remove the second product.Did not set to storage why?</p>
  
  <p>Kindly advice me,</p>
  
  <p>Thanks</p>