原始值

EmployeeListComponent 接受員工清單及部門名稱做為輸入內容。當使用者嘗試移除或新增員工時,元件會觸發相應的輸出。此元件也會定義 calculate 方法,用於實作業務計算。

以下是 EmployeeListComponent 的範本:

<h1 title="Department">{{ department }}</h1>
<mat-form-field>
  <input placeholder="Enter name here" matinput="" type="text" [(ngmodel)]="label" (keydown)="handleKey($event)">
</mat-form-field>
<mat-list>
  <mat-list-item *ngfor="let item of data">
    <h3 matline="" title="Name">
      {{ item.label }}
    </h3>
    <md-chip title="Score" class="mat-chip mat-primary mat-chip-selected" color="primary" selected="true">
      {{ calculate(item.num) }}
    </md-chip>
  </mat-list-item>
</mat-list>