<div class="container">
  <div class="row">
    <div class="content-block">
      <h2 class="title">修改公佈欄資料</h2>
      <form #editAnnounceData="ngForm">
        <div class="form-group">
          <label for="title">標題</label>
          <span *ngIf="title.invalid && (title.dirty || title.touched)">
            <span class="invalidMessage" *ngIf="title?.errors.required">*此欄必填</span>
          </span>
          <input type="text" class="form-control" id="title" name="title" #title="ngModel" [(ngModel)]="selectedItem.Title"
            required placeholder="標題">
        </div>
    <div class="form-group">
      <label for="content">摘要</label>
      <span *ngIf="content.invalid && (content.dirty || content.touched)">
        <span class="invalidMessage" *ngIf="content?.errors.required">*此欄必填</span>
      </span>
      <textarea type="text" class="form-control" id="content" name="content" #content="ngModel" [(ngModel)]="selectedItem.Content"
        required placeholder="摘要"></textarea>
    </div>
    <div class="form-group">
      <label for="startOn">公告日期</label>
      <span *ngIf="announceData.StartOn">
        <span class="invalidMessage" *ngIf="!announceData.StartOn">*此欄必填</span>
      </span>
      <div class="form-control">
        <my-date-picker name="startDT" [options]="myDatePickerOptions" [(ngModel)]="this.startDT" required></my-date-picker>
      </div>
    </div>
        <div class="btn-footer">
          <button type="submit" class="btn btn-danger" (click)="backPreviousPage()">
            <i class="fa fa-chevron-left" aria-hidden="true"></i> 回上一頁
          </button>
          <button type="button" class="btn btn-success" [disabled]="!editAnnounceData.form.valid" (click)="doEditAnnounce()">
            送出
            <i class="fa fa-chevron-right" aria-hidden="true"></i>
          </button>
        </div>
      </form>
    </div>
  </div>
</div>
