title: Ionic 3 TypeScript Error - Property 'then' does not exist on type 'void'
body: <p>I am new Ionic and was trying a tutorial when I got an error <code>TypeScript Error - Property 'then' does not exist on type 'void'</code>.</p>
  
  <p>Its a simple ionic application to save notes. The notes are saved into ionic storage.</p>
  
  <p>The code below is my service page code</p>
  
  <pre><code>import { HttpClient } from '@angular/common/http';
  import { Injectable } from '@angular/core';
  import { Storage  } from '@ionic/storage';
  import { Note  } from '../../models/note.model';
  @Injectable()
  export class NoteService {
    private notes: Note[] = [];
    private note: Note;
    constructor(public storage: Storage) {
  
    }
    saveNote(note: Note){
      note.created_at = Date.now();
      this.notes.push(note);
      this.storage.set('notes', this.notes);
    }
    getAllNotes(){
      return this.storage.get('notes').then(
          (notes) =&gt; {
              this.notes = notes == null ? [] : notes;
              return [...this.notes];
          }   
      )
    }
    deleteNote(created_at: number){
      this.notes = this.notes.filter((note) =&gt; {
          return note.created_at !== created_at
      })
      this.storage.set('notes', this.notes);
    }
    getNote(created_at: number){
      this.storage.get('notes').then((notes) =&gt; {
          this.note = [...notes].find(r =&gt; r.created_at === created_at);
          return this.note;
      }).catch(error =&gt; {
          console.log(error);
      });
    }
  }
  </code></pre>
  
  <p>The code below is my home.ts file</p>
  
  <pre><code>import { Component } from '@angular/core';
  import { NavController } from 'ionic-angular';
  import { AddNotePage } from '../add-note/add-note';
  import { NoteService } from '../../providers/note-service/note-service';
  import { Note  } from '../../models/note.model';
  import { ViewNotePage } from '../view-note/view-note';
  @Component({
    selector: 'page-home',
    templateUrl: 'home.html'
  })
  export class HomePage {
    private notes: Promise&lt;Note[]&gt;;
    private note: Note;
    constructor(public navCtrl: NavController, private noteService: NoteService) { }
    ionViewWillEnter(){
      this.notes = this.getAllNotes();
    }
    addNote(){
      this.navCtrl.push(AddNotePage);
    }
    getNote(created_at: number){
      this.noteService.getNote(created_at).then((n) =&gt; {
        this.note = n;
        this.navCtrl.push(ViewNotePage, { note: this.note });
      });
    }
    getAllNotes(){
      return this.noteService.getAllNotes();
    }
  }
  </code></pre>
  
  <p></p>
  
  <p><a href="https://i.stack.imgur.com/eJiJ3.png" rel="nofollow noreferrer">Here is the error displayed on the browser</a> </p>