File
Implements
Metadata
| changeDetection |
ChangeDetectionStrategy.OnPush |
| selector |
cx-order-confirmation-items |
| templateUrl |
./order-confirmation-items.component.html |
Methods
|
ngOnDestroy
|
ngOnDestroy()
|
|
|
|
|
|
order$
|
Type : Observable<Order>
|
|
|
|
promotionLocation
|
Type : PromotionLocation
|
Default value : PromotionLocation.Checkout
|
|
|
import {
ChangeDetectionStrategy,
Component,
OnDestroy,
OnInit,
} from '@angular/core';
import { CheckoutFacade } from '@spartacus/checkout/root';
import { Order, PromotionLocation } from '@spartacus/core';
import { Observable } from 'rxjs';
@Component({
selector: 'cx-order-confirmation-items',
templateUrl: './order-confirmation-items.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrderConfirmationItemsComponent implements OnInit, OnDestroy {
promotionLocation: PromotionLocation = PromotionLocation.Checkout;
order$: Observable<Order>;
constructor(protected checkoutService: CheckoutFacade) {}
ngOnInit() {
this.order$ = this.checkoutService.getOrderDetails();
}
ngOnDestroy() {
this.checkoutService.clearCheckoutData();
}
}
<div class="cx-order-items container" *ngIf="order$ | async as order">
<h4 class="cx-order-items-header">
{{ 'checkoutOrderConfirmation.orderItems' | cxTranslate }}
</h4>
<cx-promotions
[promotions]="order.appliedOrderPromotions || []"
></cx-promotions>
<cx-cart-item-list
[items]="order.entries"
[readonly]="true"
[promotionLocation]="promotionLocation"
></cx-cart-item-list>
</div>
Legend
Html element with directive