This file contains 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
Let assume you have a third party angular component, myExtComp and you are using it in your own component like this: | |
<myExtComp (onItemClicked)="myItemClicked($event)"> </myExtComp> | |
Notice the third party component exposes only a click event. What if instead of the click event, you would like to | |
listen for a double click event. Well with rxjs, this is very trivial. Look at how you can adapt an external click | |
event into a double click event in angular using rxjs | |
import { Component, OnInit, ViewChild, ViewEncapsulation, ChangeDetectorRef, AfterViewInit, Injector } from '@angular/core'; | |
import { Subject, fromEvent, asyncScheduler } from 'rxjs'; | |
import { debounceTime, map, distinctUntilChanged, filter, buffer, } from 'rxjs/operators'; |