fixed how the dialog was passing data back to the parent component

pull/3/head
Chris Veilleux 2019-04-02 16:57:17 -05:00
parent 6d6408b6b6
commit 79129190c8
4 changed files with 14 additions and 4 deletions

View File

@ -61,7 +61,12 @@ export class InternalLoginComponent implements OnInit {
{width: '320px', data: this.loginForm.controls['email']}
);
dialogRef.afterClosed().subscribe(
() => { this.resetPassword(); }
(result) => {
if (result) {
this.loginForm.controls['email'].setValue(result);
this.resetPassword();
}
}
);
}

View File

@ -15,7 +15,8 @@
</mat-form-field>
</div>
<div mat-dialog-actions>
<button mat-button [disabled]="!dialogData.valid" (click)="onSubmit()">
<button mat-button id="cancel-button" (click)="onCancelClick()">CANCEL</button>
<button mat-button id="submit-button" [disabled]="!dialogData.valid" [matDialogClose]="dialogData.value">
SUBMIT
</button>
</div>

View File

@ -11,7 +11,11 @@ mat-form-field {
min-width: 270px;
}
button {
#cancel-button {
margin-top: 8px;
}
#submit-button {
@include action-button-primary;
margin-top: 8px;
}

View File

@ -17,7 +17,7 @@ export class PasswordResetComponent implements OnInit {
ngOnInit() {
}
onSubmit() {
onCancelClick() {
this.dialogRef.close();
}