angular2 *ngIf的用法

<div *ngIf="show; then thenBlock; else elseBlock">this is ignoreddiv>
  <ng-template #thenBlock>如果show的值是真,则显示这段ng-template>
  <ng-template #elseBlock>如果show的值是假,则显示这段ng-template>

更多详细:
http://www.jb51.net/article/114328.htm

你可能感兴趣的:(angular2,ngIf)