title: using LocalStorage ionic 2
body: <p>I have two text fields and have to take data from both of them and store it using LocalStorage.
  So here is the code I've implemented but it's not working can you tell me to solve it.</p>
  
  <p><strong>in page1.html</strong></p>
  
  <pre><code>&lt;ion-input [(ngModel)]="hour" type="number"  &gt;&lt;/ion-input&gt;
  
   &lt;ion-input [(ngModel)]="min" type="number" &gt;&lt;/ion-input&gt;
  
  &lt;button clear (click)="setTime(hours.value,min.value)" item-right &gt;settime&lt;/button&gt;
  </code></pre>
  
  <p><strong>in pag1.ts</strong></p>
  
  <pre><code>export class Page1 {
  
     public hour;
     public min;
     public local:Storage; 
  
    constructor(public nav: NavController, translate:TranslateService) {}
  
  
   setTime(hour, min){
  
     if(hour&lt;24 &amp;&amp; hour&gt;0 &amp;&amp; min&gt;0 &amp;&amp; min&lt;61){
         this.local.set('hour',JSON.stringify(hour));
         this.local.set('min',JSON.stringify(min));
     }
     else{
       console.log("OUTOF LIMIT TIME EXCEPTION the values are "+hour+min);
     }
   }
  
    }
  </code></pre>
  
  <p>on console log, it is showing
  <code>[Object Object]</code> at the end</p>
  
  <p>and please also tell about <strong>get</strong>  from localStorage.
  Thanks in advance :-)</p>