File

feature-libs/user/profile/components/update-email/update-email.component.ts

Metadata

changeDetection ChangeDetectionStrategy.OnPush
host {
}
selector cx-update-email
templateUrl ./update-email.component.html

Index

Properties
Methods

Constructor

constructor(service: UpdateEmailComponentService)
Parameters :
Name Type Optional
service UpdateEmailComponentService No

Methods

onSubmit
onSubmit()
Returns : void

Properties

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 { UpdateEmailComponentService } from './update-email-component.service';

@Component({
  selector: 'cx-update-email',
  templateUrl: './update-email.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
  host: { class: 'user-form' },
})
export class UpdateEmailComponent {
  constructor(protected service: UpdateEmailComponentService) {}

  form: FormGroup = this.service.form;
  isUpdating$ = this.service.isUpdating$;

  onSubmit(): void {
    this.service.save();
  }
}
<cx-spinner class="overlay" *ngIf="isUpdating$ | async"> </cx-spinner>

<form (ngSubmit)="onSubmit()" [formGroup]="form">
  <label>
    <span class="label-content">{{
      'updateEmailForm.newEmailAddress.label' | cxTranslate
    }}</span>
    <input
      aria-required="true"
      type="email"
      name="email"
      formControlName="email"
      placeholder="{{
        'updateEmailForm.newEmailAddress.placeholder' | cxTranslate
      }}"
      class="form-control"
    />
    <cx-form-errors
      aria-live="assertive"
      aria-atomic="true"
      [control]="form.get('email')"
    ></cx-form-errors>
  </label>

  <label>
    <span class="label-content">{{
      'updateEmailForm.confirmNewEmailAddress.label' | cxTranslate
    }}</span>
    <input
      aria-required="true"
      type="email"
      name="confirmEmail"
      formControlName="confirmEmail"
      placeholder="{{
        'updateEmailForm.confirmNewEmailAddress.placeholder' | cxTranslate
      }}"
      class="form-control"
    />
    <cx-form-errors
      aria-live="assertive"
      aria-atomic="true"
      [control]="form.get('confirmEmail')"
    ></cx-form-errors>
  </label>

  <label>
    <span class="label-content">{{
      'updateEmailForm.password.label' | cxTranslate
    }}</span>
    <input
      aria-required="true"
      type="password"
      name="password"
      formControlName="password"
      placeholder="{{ 'updateEmailForm.password.placeholder' | cxTranslate }}"
      class="form-control"
      autocomplete="new-password"
    />
    <cx-form-errors
      aria-live="assertive"
      aria-atomic="true"
      [control]="form.get('password')"
    ></cx-form-errors>
  </label>

  <a
    class="btn btn-block btn-secondary"
    [routerLink]="{ cxRoute: 'home' } | cxUrl"
  >
    {{ 'common.cancel' | cxTranslate }}
  </a>

  <button class="btn btn-block btn-primary" [disabled]="form.disabled">
    {{ 'common.save' | cxTranslate }}
  </button>
</form>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""