<div class="container">
  <div class="row">
    <div class="content-block">
      <form #newPageForm="ngForm">
        <h2 class="title">新增頁面資料</h2>
        <div class="form-group">
          <label for="pageModule">所屬模組</label>
          <span *ngIf="pageModule.invalid && (pageModule.dirty || pageModule.touched)">
            <span class="invalidMessage" *ngIf="pageModule?.errors.required">*此欄必填</span>
          </span>
          <input type="text" class="form-control" id="pageModule" name="pageModule" [(ngModel)]="pageData.PageModule" #pageModule="ngModel"
            required placeholder="所屬模組">
        </div>
        <div class="form-group">
          <label for="pageName">頁面名稱</label>
          <span *ngIf="pageName.invalid && (pageName.dirty || pageName.touched)">
            <span class="invalidMessage" *ngIf="pageName?.errors.required">*此欄必填</span>
          </span>
          <input type="text" class="form-control" id="pageName" name="pageName" [(ngModel)]="pageData.PageName" #pageName="ngModel"
            required placeholder="頁面名稱">
        </div>
        <div class="form-group">
          <label for="pageUrl">頁面位址</label>
          <span *ngIf="pageUrl.invalid && (pageUrl.dirty || pageUrl.touched)">
            <span class="invalidMessage" *ngIf="pageUrl?.errors.required">*此欄必填</span>
          </span>
          <input type="text" class="form-control" id="pageUrl" name="pageUrl" [(ngModel)]="pageData.PageUrl" #pageUrl="ngModel" required
            placeholder="頁面位址">
        </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="submit" class="btn btn-success" [disabled]="!newPageForm.form.valid" (click)="postPageDataList()">送出
            <i class=" fa fa-chevron-right " aria-hidden="true "></i>
          </button>
        </div>
      </form>
    </div>
  </div>
</div>
