title: how can i use ionViewDidLoad() in a component?
body: <p>Hello I'm working on <code>ionic 3</code> and I have data stored in local storage. I would like to use these data in a component , but <code>ionViewDidLoad</code> (which is work perfectly in a normal page) doesn't work on a component and I have got the below error: </p>
  
  <p><a href="https://i.stack.imgur.com/WFAtU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WFAtU.png" alt="this error"></a></p>
  
  <p>So please is there any other suggestions ?<br>
  component code (offre.ts):</p>
  
  <pre><code>    import { Component, Input , Output } from '@angular/core';
  import { AngularFireDatabase, FirebaseListObservable } from "angularfire2/database"; 
  import { IonicPage, NavController, NavParams} from 'ionic-angular';
  import { NativeStorage } from '@ionic-native/native-storage';
  
  @Component({
    selector: 'offre',
    templateUrl: 'offre.html',
  
  })
  export class OffreComponent {
  
      @Input('var') var;
      text: string;
      datas: FirebaseListObservable&lt;any&gt;;
      user : any ;
  
    constructor(public navCtrl: NavController, public db: AngularFireDatabase, public nativeStorage: NativeStorage) {
      this.datas=db.list('/posts');
  
  
    }
  
    ngAfterViewInit(){
      console.log(this.var);
    }
  }
  </code></pre>