Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 29, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 29, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 29, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 29, 2025

      Gemini can now watch Google Drive videos for you – including work meetings

      May 29, 2025

      LG is still giving away a free 27-inch gaming monitor, but you’ll have to hurry

      May 29, 2025

      Slow Roku TV? This 30-second fix made my system run like new again

      May 29, 2025

      Hume’s new EVI 3 model lets you customize AI voices – how to try it

      May 29, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Your Agentforce Readiness Assessment

      May 29, 2025
      Recent

      Your Agentforce Readiness Assessment

      May 29, 2025

      Introducing N|Sentinel: Your AI-Powered Agent for Node.js Performance Optimization

      May 29, 2025

      FoalTS framework – version 5 is released

      May 29, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      KB5058499 finally makes Windows 11 24H2 stable for gaming, and it wasn’t Nvidia’s fault

      May 29, 2025
      Recent

      KB5058499 finally makes Windows 11 24H2 stable for gaming, and it wasn’t Nvidia’s fault

      May 29, 2025

      Transform Your Workflow With These 10 Essential Yet Overlooked Linux Tools You Need to Try

      May 29, 2025

      KNOPPIX is a bootable Live system

      May 29, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»PrimeNG setup in Angular 19

    PrimeNG setup in Angular 19

    January 19, 2025

    1. What is PrimeNG?

    PrimeNG is an open-source library with prebuilt and customizable UI components that speed up the development process for Angular. It comes under the free-to-use MIT license.

    2. Find your Angular version

    Run the command ‘ng v’ in your terminal to find the Angular version.



    Fig 1: Angular version

    3. Install PrimeNG

    3.1. Install PrimeNG and PrimeNG theme

    Run the command ‘npm install primeng @primeng/themes’ in your terminal to install PrimeNG and its themes.

    3.2. Possible encountering installation error

    You may face an installation error while installing the PrimeNG npm packages.



    Fig 2: PrimeNG installation error

    3.4. Solution to installation failure

    Fix the upstream dependency conflict or retry this command with –force

    Retry the same command with ‘–force’,

    ‘npm install primeng @primeng/themes –save –force’ to install the PrimeNG packages.

    4. Verify your installation

    Verify the installation of PrimeNG by checking the package.json file.



    Fig 3: PrimeNG verify installation

    5. Add reference to PrimeNG

    5.1. Add reference to PrimeNG (app.config.ts approach)

    Add a reference to PrimeNG animation, ProvidePrimeNG, and the theme (‘Aura’) in your app.config.ts to use the PrimeNG UI components across your Angular project. You may not have needed to manually add the CSS references in the angular.json or global styles.css file because it will be taken care of by the PrimeNG themes package in the newer PrimeNG version 19.

    app.config.ts,
    
    import { ApplicationConfig } from '@angular/core';
    import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
    import { providePrimeNG } from 'primeng/config';
    import Aura from '@primeng/themes/aura';
    
    export const appConfig: ApplicationConfig = {
        providers: [
            provideAnimationsAsync(),
            providePrimeNG({
                theme: {
                    preset: Aura
                }
            })
        ]
    };
    
    
    ButtonDemo.Component.ts,
    
    import { Component } from '@angular/core';
    import { ButtonModule } from 'primeng/button';
    
    @Component({
        selector: 'button-demo',
        templateUrl: './button-demo.html',
        standalone: true,
        imports: [ButtonModule]
    })
    export class ButtonDemo {}
    
    ButtonDemo.Component.html
    <div class="card flex justify-center">
        <p-button label="Check" />
    </div>
    

    5.2 Add reference to PrimeNG (app.module.ts approach)

    app.module.ts,
    
    import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
    import { providePrimeNG } from 'primeng/config';
    import Aura from '@primeng/themes/aura';
    
    import { ButtonModule } from 'primeng/button';
    
    @NgModule({
      declarations: [
        AppComponent
      ],
      imports: [
        BrowserModule,
        AppRoutingModule,
        FormsModule,
        HttpClientModule,
        ButtonModule
      ],
      providers: [provideAnimationsAsync(),
        providePrimeNG({
            theme: {
                preset: Aura
            }
        })],
      bootstrap: [AppComponent]
    })
    export class AppModule { }
    
    ButtonDemo.Component.html
    <div class="card flex justify-center">
        <p-button label="Check" />
    </div>
    
    

    5.3 Output (Button)

    Fig 4: Output (Button)

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleBetween Design and Development
    Next Article TikTok Goes Dark in the U.S. as Federal Ban Takes Effect January 19, 2025

    Related Posts

    Development

    How to Build an AI-Powered Cooking Assistant with Flutter and Gemini

    May 29, 2025
    Development

    Learn Python for Data Science – Full Course for Beginners

    May 29, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    AI Regulations for Financial Services: Hong Kong

    Development

    Supercharge Customer Journeys with Salesforce OmniStudio

    Development

    Enhancing Financial Services with On-Device AI: Security and User Experience

    Development

    DolphinGemma: How Google AI is helping decode dolphin communication

    Artificial Intelligence

    Highlights

    CVE-2024-30146 – HCL Domino Leap Unauthenticated Server-Side File Inclusion

    April 30, 2025

    CVE ID : CVE-2024-30146

    Published : April 30, 2025, 10:15 p.m. | 54 minutes ago

    Description : Improper access control of endpoint in HCL Domino Leap
    allows certain admin users to import applications from the
    server’s filesystem.

    Severity: 4.1 | MEDIUM

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    Automatic language detection improvements: increased accuracy & expanded language support

    August 29, 2024

    How Amazon trains sequential ensemble models at scale with Amazon SageMaker Pipelines

    December 17, 2024

    Planet Technology Industrial Switch Flaws Risk Full Takeover – Patch Now

    April 26, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.