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 auto in Slider
</h2>
<h3>Selected Value : {{value}}</h3>
<h5>No Step</h5>
<mat-slider
[(ngModel)]="value"
tickInterval="auto">
</mat-slider>
<h5>Step 10</h5>
<mat-slider
[(ngModel)]="value"
tickInterval="auto"
step="10">
</mat-slider>
<h5>Step 25</h5>
<mat-slider
[(ngModel)]="value"
tickInterval="auto"
step="25">
</mat-slider>
app.module.ts [import]
import { MatSliderModule } from '@angular/material/slider';
import { FormsModule } from '@angular/forms';
- 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 use vertical Slider
- angular material - How to change Slider width
- angular bootstrap - Timepicker with second
- angular bootstrap - How to use Datepicker
- angular bootstrap - Datepicker default selected date
- angular bootstrap - Select date range from Datepicker popup
- angular bootstrap - Open an Accordion panel at a time
- angular bootstrap - Disable collapse close Accordion panel
- angular bootstrap - How to show vertical pills in a Nav
- angular material - How to use stroked Button
- angular material - How to use mini FAB