Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- emailMatch(input1: HTMLInputElement, input2: HTMLInputElement) {
- const input1$ = Observable.fromEvent(input1, 'keyup')
- .map((evt: any) => evt.target.value);
- const input2$ = Observable.fromEvent(input2, 'keyup')
- .map((evt: any) => evt.target.value);
- return input1$.merge(input2$)
- .filter(text => text.length > 3)
- .filter(res => {
- return input1.value === input2.value;
- })
- }
- }
- emailMatch(this.emailRef.nativeElement, this.emailRef2.nativeElement)
- .subscribe(
- res => console.log ('MATCH', res),
- err => console.log ('MATCH ERROR', err),
- () => console.log ('MATCH DONE'),
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement