title: How do I initialize a property before use in a ionic and ion-selectable filter service?
body: <p>I have a service that can use manually entered data in an array and everything works fine.  However when I retrieve data from a database, the public geemployee: GElist[] runs before finishing retrieving the data.  If I bring the data retrieval into the same service I receive the Error Property 'databaseModelEmployees' is used before its initialization.  How can I initialize this data before use?</p>
  <p>ts</p>
  <pre><code>import { Contractor } from '../../types';
  import { FindingCat } from '../../types';
  import { GElist } from '../../types';
  import { DatabaseModelService } from './database-model.service';
  import { Storage } from '@ionic/storage';
  
  @Injectable()
  export class EmployeeService {
    databaseModelEmployees: any;
    public contractors: Contractor[] = this.databaseModelService.databaseModel[0].Contractor;
    public findingcat: FindingCat[] = this.databaseModelService.databaseModel[1].FindingCat;
    public geemployee: GElist[] = this.databaseModelService.databaseModelEmployees; // runs before the data is retrieved
    public geemployee2: GElist[] = this.databaseModelEmployees;  // failProperty 'databaseModelEmployees' is used before its initialization.
  
    constructor( 
      private databaseModelService: DatabaseModelService, 
      public storage: Storage ) { 
        this.getData();
    }
  
    getData() {
      this.storage.get(&quot;favEmployees&quot;).then((employees) =&gt; { 
        let employeeList = JSON.parse(employees)
        this.databaseModelEmployees = employeeList;
      });
    }
  }
  </code></pre>