Angular PrimeNG ProgressBar Indeterminate
Last Updated :
29 Aug, 2022
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:
- value: It specifies the current value of the progress. It accepts a number of data types, the default value is null.
- mode: It specifies the mode of the progress, the valid values are “determinate” and “indeterminate”. It is of string data type, the default value is determinate.
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.
app.component.html
< h2 style = "color: green" >GeeksforGeeks</ h2 >
< h5 >
Angular PrimeNG
ProgressBar Indeterminate
</ h5 >
< p-progressBar
mode = "indeterminate" >
</ p-progressBar >
|
app.component.ts
import { Component } from '@angular/core' ;
@Component({
selector: 'app-root' ,
templateUrl: './app.component.html'
})
export class AppComponent {}
|
app.module.ts
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.
app.component.html
< h2 style = "color: green" >GeeksforGeeks</ h2 >
< h5 >Angular PrimeNG ProgressBar Indeterminate</ h5 >
< p-progressBar
mode = "indeterminate" [style]="
{
'height': '10px',
'width': '300px'
}">
</ p-progressBar >
|
app.component.ts
import { Component } from '@angular/core' ;
@Component({
selector: 'app-root' ,
templateUrl: './app.component.html'
})
export class AppComponent {}
|
app.module.ts
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
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...