Components
DiscountInfo
The DiscountInfo component is a reusable Angular component that displays promotional messages with an icon and animations, designed for user engagement.
Features
- Icon Support: Displays a customizable icon to highlight promotions.
- Animated Styles: Includes pulse animation for eye-catching emphasis.
- Responsive Design: Aligns and sizes text and icons for optimal readability.
- Dynamic Content: Allows easy updates to promotional messages.
- Customizable Inputs: Provides inputs for dynamic control of the discount value and customer amount.
Inputs
The DiscountInfoComponent provides the following inputs to customize its content dynamically:
discountValue(number): Specifies the discount value in dollars. Defaults to100.customersAmount(number): Specifies the number of customers eligible for the discount. Defaults to10.
Usage
Step 1: Import the Component
Add the DiscountInfoComponent to your Angular project by including it in your module or component imports array.
Step 2: Add the Template
Include the component in your template and use the inputs to customize its behavior:
Step 3: Dynamic Customization
Control the content dynamically by binding the inputs to component properties:
Component Structure
HTML Template
The default structure includes:
- Icon: Highlighted with animation for visibility.
- Text: Styled for promotional emphasis with customizable content.
Example Template
Notes
- Use the
discountValueandcustomersAmountinputs to dynamically update the promotional content. - The component automatically handles singular and plural forms based on the
customersAmountvalue.