title: How to pass service returned data as an input of child component? Angular 2
body: <p>I am trying to pass data that I am getting from my service call to the input of my child component but its always undefined or null. I have figured out the reason but don't know how to solve. The reason in my opinion is when the child component is rendered, the (uninitialized) variable is not yet set by the HTTP call so it gets passed uninitialized.</p>
  
  <p>My parent component:</p>
  
  <pre><code>@Component({
      selector: 'live-auction',
      templateUrl: BaseConfigurations.baseTemplatePath + '/live/index.html',
      providers: [AuctionService]
  })
  export class LiveAuctionComponent {
      private auction: CarAuction = new CarAuction();
  
      public initialize() {
          this.getCarAuction();
      }
  
      getCarAuction(): void {
          this.auctionservice.getCarAuctions().subscribe(auction =&gt; {
                  this.auction = auction;
              },
              error =&gt; this.onError(error));
      }
  }
  </code></pre>
  
  <p>Child component:</p>
  
  <pre><code>@Component({
      selector: 'sellers-upcoming-auctions',
      templateUrl: BaseConfigurations.baseTemplatePath + '/auctions/upcoming/sellerAuctions.html',
      inputs: ['sellerid', 'take']
  })
  
  export class SellerUpcomingAuctionsComponent extends BaseConfigurations {
      private sellerid: string;
      private take: number;
  
      public initialize() {
          console.log(this.sellerid);
      }
  
      constructor() {
          super();
      }
  }
  </code></pre>
  
  <p>In my index.html (parent's component template)</p>
  
  <pre><code>&lt;h3&gt;Parent Template&lt;/h3&gt;
  &lt;sellers-upcoming-auctions [sellerid]="auction.SellerUserId" take="4"&gt;&lt;/sellers-upcoming-auctions&gt;
  </code></pre>
  
  <p>This line below:</p>
  
  <pre><code>[sellerid]="auction.SellerUserId"
  </code></pre>
  
  <p>should somehow pass the updated value (or wait for http call to return response). Something like promise or observeable might be a solution but I don't know how? </p>
  
  <p>Thank you</p>