Created
          May 20, 2018 13:05 
        
      - 
      
 - 
        
Save realtomaszkula/6fd99e24e40796699e0a363a42cc5d88 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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