File

feature-libs/checkout/components/order-confirmation/components/order-confirmation-totals/order-confirmation-totals.component.ts

Implements

OnInit OnDestroy

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector cx-order-confirmation-totals
templateUrl ./order-confirmation-totals.component.html

Index

Properties
Methods

Constructor

constructor(checkoutService: CheckoutFacade)
Parameters :
Name Type Optional
checkoutService CheckoutFacade No

Methods

ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void

Properties

order$
Type : Observable<Order>
import {
  ChangeDetectionStrategy,
  Component,
  OnDestroy,
  OnInit,
} from '@angular/core';
import { CheckoutFacade } from '@spartacus/checkout/root';
import { Order } from '@spartacus/core';
import { Observable } from 'rxjs';

@Component({
  selector: 'cx-order-confirmation-totals',
  templateUrl: './order-confirmation-totals.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrderConfirmationTotalsComponent implements OnInit, OnDestroy {
  order$: Observable<Order>;

  constructor(protected checkoutService: CheckoutFacade) {}

  ngOnInit() {
    this.order$ = this.checkoutService.getOrderDetails();
  }

  ngOnDestroy() {
    this.checkoutService.clearCheckoutData();
  }
}
<div class="cx-order-summary container" *ngIf="order$ | async as order">
  <div class="row justify-content-end">
    <div class="col-sm-12 col-md-6 col-lg-5 col-xl-4">
      <cx-order-summary [cart]="order"></cx-order-summary>
    </div>
  </div>
</div>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""