projects/apttus/elements/src/lib/price/price.component.ts
Wrapper component for displaying the price of a record. Supports cart, product, cart item, product options and orders. Change detection on this component has been tuned, so use this component in favor of using the price pipes directly.
import { PriceModule } from '@apttus/elements';
@NgModule({
imports: [PriceModule, ...]
})
export class AppModule {}
// Basic Usage
<apt-price [record]="product"></apt-price>
// All inputs and outputs.
<apt-price
[record]="product"
[quantity]="1"
[attributeValue]="attributeValue"
[formatted]="false"
[type]="total"
[term]="term"
[bundle]="true"
></apt-price>
| changeDetection | ChangeDetectionStrategy.OnPush |
| selector | apt-price |
| styles |
:host{
display: block;
}
|
| template | |
Inputs |
constructor(priceService: PriceService, localCurrencyPipe: LocalCurrencyPipe)
|
|||||||||
|
Parameters :
|
| attributeValue |
Type : ProductAttributeValue
|
|
Instance of ProductAttributeValue used to calculate the price of bundle product record. |
| bundle |
Type : boolean
|
Default value : false
|
|
Flag to set this product type as a bundle |
| formatted |
Type : boolean
|
Default value : true
|
|
Optional boolean argument to display the price as a formatted currency or as a raw number (defaults to true) |
| options |
Type : Array<AssetLineItem | QuoteLineItem | OrderLineItem>
|
| quantity |
Type : number
|
Default value : 1
|
|
The quantity of the record (defaults to 1) |
| term |
Type : number
|
|
Term used to calculate price of bundle product. |
:host{
display: block;
}