Skip to content

Instantly share code, notes, and snippets.

@realtomaszkula
Created May 20, 2018 13:05
Show Gist options
  • Save realtomaszkula/6fd99e24e40796699e0a363a42cc5d88 to your computer and use it in GitHub Desktop.
Save realtomaszkula/6fd99e24e40796699e0a363a42cc5d88 to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { filter } from 'rxjs/operators';
@Component({
selector: 'app-price-range',
template: `
<form [formGroup]="form">
<mat-slider formControlName="rangeStart" thumbLabel min="1" max="5" step="0.5" value="1.5"></mat-slider>
<mat-slider formControlName="rangeEnd" thumbLabel min="1" max="5" step="0.5" value="1.5"></mat-slider>
</form>
`,
styleUrls: ['./price-range.component.css']
})
export class PriceRangeComponent implements OnInit {
form: FormGroup;
constructor(private fb: FormBuilder) {}
ngOnInit() {
this.form = this.fb.group({
rangeStart: 0,
rangeEnd: 0
});
this.reactiveRange();
}
reactiveRange() {
// continue reading to see the implementation
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment