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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 30, 2025

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

      May 30, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 30, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 30, 2025

      Does Elden Ring Nightreign have crossplay or cross-platform play?

      May 30, 2025

      Cyberpunk 2077 sequel enters pre-production as Phantom Liberty crosses 10 million copies sold

      May 30, 2025

      EA has canceled yet another game, shuttered its developer, and started more layoffs

      May 30, 2025

      The Witcher 3: Wild Hunt reaches 60 million copies sold as work continues on The Witcher 4

      May 30, 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

      How Remix is shaking things up

      May 30, 2025
      Recent

      How Remix is shaking things up

      May 30, 2025

      Perficient at Kscope25: Let’s Meet in Texas!

      May 30, 2025

      Salesforce + Informatica: What It Means for Data Cloud and Our Customers

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

      Does Elden Ring Nightreign have crossplay or cross-platform play?

      May 30, 2025
      Recent

      Does Elden Ring Nightreign have crossplay or cross-platform play?

      May 30, 2025

      Cyberpunk 2077 sequel enters pre-production as Phantom Liberty crosses 10 million copies sold

      May 30, 2025

      EA has canceled yet another game, shuttered its developer, and started more layoffs

      May 30, 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

    Hostinger

    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

    Hostinger
    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

    Security

    China-Linked Hackers Exploit SAP and SQL Server Flaws in Attacks Across Asia and Brazil

    May 30, 2025
    Security

    New Apache InLong Vulnerability (CVE-2025-27522) Exposes Systems to Remote Code Execution Risks

    May 30, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    CVE-2025-4280 – Poedit for MacOS Privilege Escalation Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Distribution Release: IPFire 2.29 Core 192

    News & Updates

    CVE-2025-3928 – Commvault Web Server Remote Webshell Execution

    Common Vulnerabilities and Exposures (CVEs)

    I tried an ultra-thin iPhone case, and here’s how my daunting experience went

    Development
    Hostinger

    Highlights

    Development

    Asynchronous AI Agent Framework: Enhancing Real-Time Interaction and Multitasking with Event-Driven FSM Architecture

    November 16, 2024

    While today’s LLMs can skillfully use various tools, they still operate synchronously, only processing one…

    Windows 11 24H2 to get new features in February – what’s coming

    January 7, 2025

    Agentless: An Agentless AI Approach to Automatically Solve Software Development Problems

    July 11, 2024

    Gemini breaks new ground: a faster model, longer context and AI agents

    May 29, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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