create.component.html 2.29 KB
Newer Older
Natthaphong Malaphan's avatar
Natthaphong Malaphan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
<mat-card class="example-card">
  <mat-card-header>
    <h3>บันทึกข้อมูล</h3>
  </mat-card-header>
  <form>
    <div class="example-container">
      <p style="text-align: center">
        <mat-form-field appearance="outline" style="width: 400px">
          <mat-label>หมวดหมู่หนัง</mat-label>
          <br />
          <mat-select [(ngModel)]="reviewAdd.catagory" name="catagory">
            <mat-option
              value="option"
              *ngFor="let catagory of catagorys"
              [value]="catagory.type"
              >{{ catagory.type }}</mat-option
            >
          </mat-select>
        </mat-form-field>
        <br />
        <mat-form-field appearance="outline" style="width: 400px">
          <mat-label>ชื่อหนัง</mat-label>
          <input
            matInput
            placeholder="Placeholder"
            name="namemovie"
            [(ngModel)]="reviewAdd.namemovie"
          />
        </mat-form-field>
        <br />
        <mat-form-field appearance="outline" style="width: 400px">
          <mat-label>หัวข้อ</mat-label>
          <input
            matInput
            placeholder="Placeholder"
            name="title"
            [(ngModel)]="reviewAdd.title"
          />
        </mat-form-field>
        <br />
        <mat-form-field appearance="outline" style="width: 400px">
          <mat-label>คำอธิบาย</mat-label>
          <textarea
            rows="10"
            matInput
            placeholder="Placeholder"
            name="description"
            [(ngModel)]="reviewAdd.description"
          ></textarea>
        </mat-form-field>
      </p>
    </div>
    <p style="text-align: center">
      <button
        style="width: 200px; margin-right: 5%"
        mat-raised-button
        (click)="submitReviewAdd()"
        color="primary"
        *ngIf="
          reviewAdd.catagory &&
          reviewAdd.namemovie &&
          reviewAdd.title &&
          reviewAdd.description
        "
      >
        บันทึก
      </button>
      <button
        style="width: 100px; background-color: #d32f2f; color: white"
        mat-raised-button
        routerLink="/"
      >
        ยกเลิก
      </button>
    </p>
  </form>
</mat-card>
<br />
<br />
<br />
<br />