Last active
December 8, 2018 10:59
-
-
Save takuya-nakayasu/797d09c60b204d7dcdc2d1beba1602ec to your computer and use it in GitHub Desktop.
コンポーネントクラスのHTMLファイル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<mat-card class="login-card"> | |
<mat-card-header> | |
<mat-card-title class="login-title">アカウント登録</mat-card-title> | |
</mat-card-header> | |
<mat-card-content> | |
<form [formGroup]="nameRegisterForm" (ngSubmit)="onSubmit()" class="login-form"> | |
<!-- 氏名の入力フォーム --> | |
<mat-form-field class="input-field"> | |
<input matInput placeholder="氏名(姓と名の間にスペースを入力してください)" | |
id="name" name="name" [formControl]="nameRegisterForm.controls.name" required> | |
<!-- 必須入力のエラーメッセージ --> | |
<mat-error *ngIf="nameRegisterForm.controls.name.errors?.required">氏名は必須項目です</mat-error> | |
<!-- スペースがない場合のエラーメッセージ --> | |
<mat-error *ngIf="nameRegisterForm.controls.name.errors?.haveBlank">姓と名の間にはスペースを入力してください</mat-error> | |
</mat-form-field> | |
<!-- パスワードの入力フォーム --> | |
<mat-form-field class="input-field"> | |
<input [type]="hide ? 'password' : 'text'" matInput | |
placeholder="パスワード" id="password" name="password" [formControl]="nameRegisterForm.controls.password" required> | |
<mat-icon matSuffix (click)="hide = !hide">{{hide ? 'visibility' : 'visibility_off'}}</mat-icon> | |
<mat-error *ngIf="nameRegisterForm.controls.password.errors?.required">パスワードは必須項目です</mat-error> | |
</mat-form-field> | |
<!-- 確認用パスワードの入力フォーム --> | |
<mat-form-field class="input-field"> | |
<input [type]="hide ? 'confirmPassword' : 'text'" matInput | |
placeholder="確認用パスワード" id="confirmPassword" name="confirmPassword" [formControl]="nameRegisterForm.controls.confirmPassword" required> | |
<mat-icon matSuffix (click)="hide = !hide">{{hide ? 'visibility' : 'visibility_off'}}</mat-icon> | |
<mat-error *ngIf="nameRegisterForm.controls.confirmPassword.errors?.required">確認用パスワードは必須項目です</mat-error> | |
<!-- パスワードが一致しないときに表示するエラー --> | |
<mat-error *ngIf="nameRegisterForm.controls.confirmPassword.errors?.notMatchPassword">パスワードが一致しません</mat-error> | |
</mat-form-field> | |
<!-- 登録ボタン --> | |
<button [appDoubleClickPrevention]="isLoading" | |
type="submit" class="register-button" | |
mat-raised-button color="primary">登録</button> | |
</form> | |
</mat-card-content> | |
</mat-card> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment