projects/congarevenuecloud/elements/src/lib/price-modal/price-modal.component.ts
This component is a work in progress.
Price Modal component can be used when pricing on cart fails for any reason. User can choose to clear the cart or reprice it, from the modal.
import { PriceModalModule } from '@congarevenuecloud/elements';
@NgModule({
imports: [PriceModalModule, ...]
})
export class AppModule {}
```typescript
<apt-price-modal></apt-price-modal>
OnInit
selector | apt-price-modal |
styleUrls | ./price-modal.component.scss |
templateUrl | ./price-modal.component.html |
Properties |
|
Methods |
constructor(cartService: CartService, modalService: BsModalService)
|
|||||||||
Parameters :
|
clearCart |
clearCart()
|
Create new cart and set it active. After that close price error modal.
Returns :
void
|
closeModal |
closeModal()
|
Close price modal.
Returns :
void
|
retryPrice |
retryPrice()
|
Call price cart API of cart.service.
Returns :
void
|
showPriceErrorModal |
showPriceErrorModal()
|
Open price modal popup.
Returns :
void
|
Public cartService |
Type : CartService
|
modalRef |
Type : BsModalRef
|
refrence for modal dialog |
<ng-template #priceModal>
<div>
<div class="modal-header">
<h4 class="modal-title d-flex align-items-center m-0 text-truncate">
{{'COMMON.PRICING_FAILED' | translate}}
</h4>
<button type="button" class="close pull-right" aria-label="Close" (click)="closeModal()">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-10">
<div>
{{'COMMON.PRICE_ERROR' | translate}}
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-outline-danger mr-2" [ladda]="btnLoader" [attr.data-style]="'zoom-in'"
(click)="clearCart()">{{'COMMON.CLEAR_CART' | translate}}</button>
<button class="btn btn-primary btn-raised" type="button" (click)="retryPrice()"
data-style="zoom-in">{{'COMMON.REPRICE_CART' | translate}}</button>
</div>
</div>
</ng-template>
./price-modal.component.scss