Open In App

Angular PrimeNG ProgressBar Indeterminate

Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. This article will show us how to use the ProgressBar Indeterminate in Angular PrimeNG. We will also learn about the properties along with their syntaxes that will be used in the code.

The ProgressBar component is used to make a bar that displays the process status.



Syntax:

<p-progressBar 
    mode="indeterminate"
    [style]="{...}">
</p-progressBar>

Angular PrimeNG ProgressBar Indeterminate properties:



Creating Angular application & module installation:

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: Install PrimeNG in your given directory.

npm install primeng --save
npm install primeicons --save

Project Structure: After complete installation, it will look like the following:

 

Run the below command to see the output:

ng serve --open

Example 1: Below is the example code that illustrates the use of Angular PrimeNG ProgressBar Indeterminate.




<h2 style="color: green">GeeksforGeeks</h2>
<h5>
      Angular PrimeNG 
    ProgressBar Indeterminate
</h5>
<p-progressBar 
    mode="indeterminate">
</p-progressBar>




import { Component } from '@angular/core';
  
@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
  
export class AppComponent {}




import { NgModule } from '@angular/core';
import { BrowserModule } 
   from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } 
  from '@angular/platform-browser/animations';
import { AppComponent } from './app.component';
import { ProgressBarModule } 
  from 'primeng/progressbar';
import { ToastModule } from 'primeng/toast';
  
@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    ProgressBarModule,
    ToastModule,
    FormsModule,
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent],
})
  
export class AppModule {}

Output:

 

Example 2: Below is another example code that illustrates the Angular PrimeNG ProgressBar Indeterminate using some styling properties.




<h2 style="color: green">GeeksforGeeks</h2>
<h5>Angular PrimeNG ProgressBar Indeterminate</h5>
<p-progressBar 
    mode="indeterminate" [style]="
    {
     'height': '10px', 
     'width': '300px'
    }">
</p-progressBar>




import { Component } from '@angular/core';
  
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html'
})
  
export class AppComponent {}




import { NgModule } from '@angular/core';
import { BrowserModule } 
   from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } 
  from '@angular/platform-browser/animations';
import { AppComponent } from './app.component';
import { ProgressBarModule } 
  from 'primeng/progressbar';
import { ToastModule } from 'primeng/toast';
  
@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    ProgressBarModule,
    ToastModule,
    FormsModule,
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent],
})
  
export class AppModule {}

Output:

 

Reference: https://primefaces.org/primeng/progressbar


Article Tags :