![]() |
Angular PrimeNG is a UI component library for Angular Applications. It offers many pre-built themes and UI components for a variety of tasks like inputs, menus, charts, Buttons, etc. In this article, we will see Angular PrimeNG Badge Directive. The Badge Component is used as an indicator for other elements like icons and avatars. It is generally used in combination with other elements to display the notification count and status info. The Badge directive can be used to apply the badge to other elements. Syntax: <i pBadge class="..." value="2"></i>
Creating Angular Application and Installing the Module: Step 1: Create an Angular application using the following command. ng new appname Step 2: After creating your project folder i.e. appname, move to it using the following command. cd appname Step 3: Finally, Install PrimeNG in your given directory. npm install primeng --save npm install primeicons --save Project Structure: The project Structure will look like this after following the above steps: ![]() Project Structure Example 1: In this example, we used the pBadge directive to apply badges to icons. app.component.html
app.component.ts
app.module.ts
Output: ![]()
Example 2: In this example, we used the pBadge directive to apply badges to avatars. app.component.html
app.component.ts
app.module.ts
Output: ![]()
Reference: http://primefaces.org/primeng/badge |
Reffered: https://www.geeksforgeeks.org
Web Technologies |
Related |
---|
|
![]() |
|
|
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 11 |