File
Implements
Metadata
| changeDetection |
ChangeDetectionStrategy.OnPush |
| selector |
cx-order-confirmation-overview |
| templateUrl |
./order-confirmation-overview.component.html |
Methods
|
ngOnDestroy
|
ngOnDestroy()
|
|
|
|
|
|
order$
|
Type : Observable<any>
|
|
|
import {
ChangeDetectionStrategy,
Component,
OnDestroy,
OnInit,
} from '@angular/core';
import { CheckoutFacade } from '@spartacus/checkout/root';
import { Observable } from 'rxjs';
@Component({
selector: 'cx-order-confirmation-overview',
templateUrl: './order-confirmation-overview.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrderConfirmationOverviewComponent implements OnInit, OnDestroy {
order$: Observable<any>;
constructor(protected checkoutService: CheckoutFacade) {}
ngOnInit() {
this.order$ = this.checkoutService.getOrderDetails();
}
ngOnDestroy() {
this.checkoutService.clearCheckoutData();
}
}
<ng-container *ngIf="order$ | async as order">
<cx-order-overview [order]="order"></cx-order-overview>
</ng-container>
Legend
Html element with directive