app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styles: [`
mat-slider{
width: 400px;
}
`]
})
export class AppComponent {
value:number = 0;
}
app.component.html
<h2 style="padding-top:25px; padding-bottom:25px;">
Angular Material - Tick interval with step in Slider
</h2>
<h3>Selected Value : {{value}}</h3>
<div>A tick always appears on a step.</div>
<div>Tick interval * Step = Draw a tick.</div>
<mat-slider
[(ngModel)]="value"
tickInterval="10">
</mat-slider>
<h5>No Step, Tick interval 10 (Tick on every 10 values)</h5>
<mat-slider
[(ngModel)]="value"
tickInterval="4"
step="5">
</mat-slider>
<h5>Step 5, Tick interval 4 (Tick on every 20 values)</h5>
<mat-slider
[(ngModel)]="value"
tickInterval="3"
step="10">
</mat-slider>
<h5>Step 10, Tick interval 3 (Tick on every 30 values)</h5>
app.module.ts [import]
import { MatSliderModule } from '@angular/material/slider';
import { FormsModule } from '@angular/forms';
- angular material - How to use indeterminate Progress spinner
- angular - How to use setTimeout()
- angular material - How to use determinate Progress spinner
- angular material - How to change Progress spinner color
- angular material - How to center Progress spinner
- angular material - How to align Tabs
- angular material - How to disable Tabs content animation
- angular material - How to generate Tabs programmatically
- angular material - How to create & add Tab programmatically
- angular material - How to use Slider
- angular material - Slider step, minimum & maximum value
- angular material - How to invert Slider
- angular material - How to show thumb label in Slider
- angular material - Slider custom formatted thumb label
- angular material - How to use Slider change event