title: Fetch additional data when ngIf condition is satisfied
body: <p>I have two simple components. One for listing users and second for detail view. </p>
  
  <p>When i select a particular user, this user binds to a variable selectedUser, ngIf in detail component gets satisfied and i wanna make additional request to fetch more data related to this user.</p>
  
  <p>What is the appropriate way to implement this? When i make custom ngIf function, it begins to make a ton of requests to my api, but i need it only once. Thanks!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@Component({
      selector: 'users',
      template: `
          &lt;div *ngFor="#user of users"
              (click)="onSelect(user)"&gt;
                  {{ user.name }}
          &lt;/div&gt;
          &lt;user-detail [user]="selectedUser"&gt;&lt;/user-detail&gt;
      `
  export class UserComponent {
      onSelect(user: IUser) {
          this.selectedUser = user;
      }
  }
  
  @Component({
      selector: 'user-detail',
      template: `
          &lt;div *ngIf="user"&gt;
              {{ user.name }} {{ user.id }}
              &lt;div *ngFor="task of tasks"&gt; &lt;-- this is what i actually try to fetch
              &lt;/div&gt;
          &lt;/div&gt;
  `
  
  export class UserDetailComponent {
      @Input() user: IUser[];
  }
  </code></pre>