Created
May 20, 2018 13:02
-
-
Save realtomaszkula/9c55d7325ff0b89142d9fad01c19a00d 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
reactiveRange() { | |
const startCtrl = this.form.get('rangeStart'); | |
const endCtrl = this.form.get('rangeEnd'); | |
startCtrl.valueChanges | |
.pipe(filter(v => v > endCtrl.value)) | |
.subscribe(v => endCtrl.setValue(v)); | |
endCtrl.valueChanges | |
.pipe(filter(v => v < startCtrl.value)) | |
.subscribe(v => startCtrl.setValue(v)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment