title: How to make IonViewDidLoad run AFTER event subscription
body: <p>Hi I am passing a data from page1 to page2 in ionic using events.</p>
  
  <p>In page 2, I use the code below to subscribe to the data that was passed from page 1. </p>
  
  <pre><code>events.subscribe('restoProfile:selected', (restoData) =&gt; {
          this.restoData = restoData;
          console.log(this.restoData);
        });
  </code></pre>
  
  <p>The <code>console.log</code> on the line above works correctly by displaying the data on the console log.</p>
  
  <p>The problem is, I am using the <code>this.restoData</code> for another function in <code>IonViewDidLoad</code>, but this function says that the content inside <code>this.restoData</code> is undefined.</p>
  
  <p>I tried to add a button which calls <code>console.log(this.restoData)</code> and the content inside <code>this.restoData</code> is logged correctly.</p>
  
  <p>I suppose the <code>IonViewDidLoad</code> runs before the event is subscribed.</p>
  
  <p>How can I make IonViewDidLoad to run <strong>AFTER</strong> the event is subscribed?</p>
  
  <p>Thanks for your help</p>