title: Angular 4 condition nested in loop
body: <p>can you help me fix my code of ng4? I have array of user models, which every have property firstName, lastName, and age like that:</p>
  
  <pre><code>export class User {
      public firstName: string;
      public lastName: string;
      public age: number;
  
      constructor(fName: string, lName: string, age: number) {
          this.firstName = fName;
          this.lastName = lName;
          this.age = age;
      }
  }
  </code></pre>
  
  <p>Here is my component.ts code:</p>
  
  <pre><code>export class UserItemComponent implements OnInit {
    users: User[];
  
    constructor() { 
      this.users = [
        new User("John", "", 16),
        new User("Jose", "", 45),
        new User("Xavier", "", 22)
      ]
    }
  
    ngOnInit() {
    }
  }
  </code></pre>
  
  <p>When I tried it without condition in template, it was working. After I've added condition, I have this issues: </p>
  
  <blockquote>
    <p>Unexpected closing tag "p". It may happen when the tag has already
    been closed by another tag.</p>
  </blockquote>
  
  <p>Do you have idea what I did wrong? Here is code of html template:</p>
  
  <pre><code>&lt;p *ngFor="let user of users"&gt;
    &lt;div *ngIf="user.age &gt; 20; then old else young"&gt;&lt;/div&gt;
    &lt;ng-template #old&gt;Hello, my name is {{user.firstName}} and I'm too old - {{user.age}}.&lt;/ng-template&gt;
    &lt;ng-template #young&gt;Hello, my name is {{user.firstName}} and I'm too years young - {{user.age}}.&lt;/ng-template&gt;
  &lt;/p&gt;
  </code></pre>