|
|
@ -1,10 +1,13 @@ |
|
|
|
<button type="button" (click)="onLoad()">載入資料</button> |
|
|
|
<button type="button" (click)="onClear()">清除資料</button> |
|
|
|
|
|
|
|
<div *ngIf="tasks.length >= 1; else empty"> |
|
|
|
<app-task *ngFor="let task of tasks; let odd = odd" [class.odd]="odd" [task]="task"></app-task> |
|
|
|
</div> |
|
|
|
<div *ngIf="tasks.length === 0; then empty else list"></div> |
|
|
|
|
|
|
|
<ng-template #empty> |
|
|
|
<div class="data-empty">無待辦事項</div> |
|
|
|
</ng-template> |
|
|
|
|
|
|
|
<ng-template #list> |
|
|
|
<app-task *ngFor="let task of tasks; let odd=odd" [class.odd]="odd" |
|
|
|
[task] = "task"></app-task> |
|
|
|
</ng-template> |