I am working on Angular 4 framework. I wanted to add a material progress bar to my app's homepage. I followed the official guide for Angular Material environment set up.
After that I added the code for progress bar in .html file and compiled. It is not been updated on the web page. How can I resolve this?
The HTML code is:
<mat-card>
<mat-card-content>
<h2 class="example-h2">Progress bar configuration</h2>
<section class="example-section">
<label class="example-margin">Color:</label>
<mat-radio-group [(ngModel)]="color">
<mat-radio-button class="example-margin" value="primary">
Primary
</mat-radio-button>
<mat-radio-button class="example-margin" value="accent">
Accent
</mat-radio-button>
<mat-radio-button class="example-margin" value="warn">
Warn
</mat-radio-button>
</mat-radio-group>
</section>
<section class="example-section">
<label class="example-margin">Mode:</label>
<mat-radio-group [(ngModel)]="mode">
<mat-radio-button class="example-margin" value="determinate">
Determinate
</mat-radio-button>
<mat-radio-button class="example-margin" value="indeterminate">
Indeterminate
</mat-radio-button>
<mat-radio-button class="example-margin" value="buffer">
Buffer
</mat-radio-button>
<mat-radio-button class="example-margin" value="query">
Query
</mat-radio-button>
</mat-radio-group>
</section>
<section class="example-section" *ngIf="mode == 'determinate' || mode == 'buffer'">
<label class="example-margin">Progress:</label>
<mat-slider class="example-margin" [(ngModel)]="value"></mat-slider>
</section>
<section class="example-section" *ngIf="mode == 'buffer'">
<label class="example-margin">Buffer:</label>
<mat-slider class="example-margin" [(ngModel)]="bufferValue"></mat-slider>
</section>
</mat-card-content>
</mat-card>
<mat-card>
<mat-card-content>
<h2 class="example-h2">Result</h2>
<section class="example-section">
<mat-progress-bar
class="example-margin"
[color]="color"
[mode]="mode"
[value]="value"
[bufferValue]="bufferValue">
</mat-progress-bar>
</section>
</mat-card-content>
</mat-card>
and the corresponding component.ts file code is
@NgModule({
imports: [MatButtonModule, MatCheckboxModule],
})
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent {
color = 'primary';
mode = 'determinate';
value = 50;
bufferValue = 75;
}
inspector. (for example inchromein DevTools there is tabelements) if mat-progress-bar is generated in html file, also check my answer, maybe there is problem with imports.