Created
June 15, 2020 10:07
-
-
Save Armenvardanyan95/fe5caf16e79e6b51c6d7dfc444b97f80 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
| @Component({ | |
| selector: 'my-component', | |
| template: '<div><input [formControl]="control"/></div>', | |
| }) | |
| export class MyComponent implements OnInit { | |
| control = new FormControl(''); | |
| ngOnInit() { | |
| fromEvent(document.body, 'click').pipe( | |
| withLatestFrom(this.control.valueChanges), | |
| ).subscribe(console.log); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment