File

feature-libs/checkout/components/components/checkout-progress/checkout-progress-mobile-bottom/checkout-progress-mobile-bottom.component.ts

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector cx-checkout-progress-mobile-bottom
templateUrl ./checkout-progress-mobile-bottom.component.html

Index

Properties
Accessors

Constructor

constructor(checkoutStepService: CheckoutStepService)
Parameters :
Name Type Optional
checkoutStepService CheckoutStepService No

Properties

Private _steps$
Type : BehaviorSubject<CheckoutStep[]>
Default value : this.checkoutStepService.steps$
activeStepIndex
Type : number
activeStepIndex$
Type : Observable<number>
Default value : this.checkoutStepService.activeStepIndex$.pipe( tap((index) => (this.activeStepIndex = index)) )

Accessors

steps$
getsteps$()
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { CheckoutStep } from '@spartacus/checkout/root';
import { BehaviorSubject, Observable } from 'rxjs';
import { tap } from 'rxjs/operators';
import { CheckoutStepService } from '../../../services/checkout-step.service';

@Component({
  selector: 'cx-checkout-progress-mobile-bottom',
  templateUrl: './checkout-progress-mobile-bottom.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CheckoutProgressMobileBottomComponent {
  private _steps$: BehaviorSubject<CheckoutStep[]> =
    this.checkoutStepService.steps$;

  constructor(protected checkoutStepService: CheckoutStepService) {}

  activeStepIndex: number;
  activeStepIndex$: Observable<number> =
    this.checkoutStepService.activeStepIndex$.pipe(
      tap((index) => (this.activeStepIndex = index))
    );

  get steps$(): Observable<CheckoutStep[]> {
    return this._steps$.asObservable();
  }
}
<div *ngIf="(activeStepIndex$ | async) !== undefined">
  <div class="cx-media">
    <div *ngFor="let step of steps$ | async; let i = index">
      <div class="cx-list-media" *ngIf="i > activeStepIndex">
        <div>{{ i + 1 }}. {{ step.name | cxTranslate }}</div>
      </div>
    </div>
  </div>
</div>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""