-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Description
I'm submitting a ... (check one with "x")
[ ] bug report
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
With the DOM renderer, one binds events just like one does when using the raw DOM api (i.e. addEventListener).
Expected/desired behavior
Being able to interface with an observable for binding DOM events.
What is the expected behavior?
Being able to interface with an observable for binding DOM events and still retain the benefits of server-side/mobile platform rendering with support for progressive web apps.
What is the motivation / use case for changing the behavior?
Currently there is no exposure to being able to manipulate an observable, which prevents easier implementations of certain behavior, such as throttling a scroll event (say for a scrollspy), or dragging & dropping components. It would also be more in line with rxjs paradigms & its integration within Angular.
Ideally, one should be able to do
this.domRenderer.createListener(this.elementRef.nativeElement, eventName)
.throttle(50)
.subscribe(...);