This commit is contained in:
Park Byung Eun 2022-08-09 12:28:41 +00:00
parent e11c423ba8
commit af143e6216
2 changed files with 18 additions and 2 deletions

View File

@ -32,7 +32,11 @@
<!-- Bcc -->
<mat-form-field>
<mat-label>회원 아이디</mat-label>
<input matInput [formControlName]="'signinId'" />
<input
matInput
[formControlName]="'signinId'"
(focusout)="__checkSigninId($event)"
/>
</mat-form-field>
<!-- Subject -->

View File

@ -1,6 +1,7 @@
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { IdentityService } from 'app/modules/polyglot/member/services/identity.service';
export interface RegistComposeData {
title: string;
@ -45,7 +46,8 @@ export class RegistComposeComponent implements OnInit {
constructor(
public matDialogRef: MatDialogRef<RegistComposeComponent>,
@Inject(MAT_DIALOG_DATA) public data: RegistComposeData,
private _formBuilder: FormBuilder
private _formBuilder: FormBuilder,
private _identityService: IdentityService
) {}
// -----------------------------------------------------------------------------------------------------
@ -116,4 +118,14 @@ export class RegistComposeComponent implements OnInit {
* Send the message
*/
send(): void {}
__checkSigninId(event: FocusEvent): void {
const signinId = this.composeForm.get('signinId')?.value;
// console.log(event, '::', signinId);
this._identityService
.checkUsernameForDuplication(signinId)
.then((isUse: boolean) => {
console.log('check username: ', isUse);
});
}
}