File
Metadata
| changeDetection |
ChangeDetectionStrategy.OnPush |
| selector |
cx-forgot-password |
| templateUrl |
./forgot-password.component.html |
|
form
|
Type : FormGroup
|
Default value : this.service.form
|
|
|
|
isUpdating$
|
Default value : this.service.isUpdating$
|
|
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { ForgotPasswordComponentService } from './forgot-password-component.service';
@Component({
selector: 'cx-forgot-password',
templateUrl: './forgot-password.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ForgotPasswordComponent {
constructor(protected service: ForgotPasswordComponentService) {}
form: FormGroup = this.service.form;
isUpdating$ = this.service.isUpdating$;
onSubmit(): void {
this.service.requestEmail();
}
}
<cx-spinner class="overlay" *ngIf="isUpdating$ | async"> </cx-spinner>
<form (ngSubmit)="onSubmit()" [formGroup]="form">
<label>
<span class="label-content">{{
'forgottenPassword.emailAddress.label' | cxTranslate
}}</span>
<input
aria-required="true"
type="email"
class="form-control"
placeholder="{{
'forgottenPassword.emailAddress.placeholder' | cxTranslate
}}"
formControlName="userEmail"
/>
<cx-form-errors
aria-live="assertive"
aria-atomic="true"
[control]="form.get('userEmail')"
></cx-form-errors>
</label>
<a
class="btn btn-block btn-secondary"
[routerLink]="{ cxRoute: 'login' } | cxUrl"
>{{ 'common.cancel' | cxTranslate }}</a
>
<button class="btn btn-block btn-primary" [disabled]="form.disabled">
{{ 'common.submit' | cxTranslate }}
</button>
</form>
Legend
Html element with directive