René's URL Explorer Experiment


Title: Proposal: Support declarative binding from View events to Observables · Issue #4062 · angular/angular · GitHub

Open Graph Title: Proposal: Support declarative binding from View events to Observables · Issue #4062 · angular/angular

X Title: Proposal: Support declarative binding from View events to Observables · Issue #4062 · angular/angular

Description: Not sure this is a good idea, or even possible, but thought I'd throw it out there. In vanilla Rx, if I wanted to listen to a DOM event to do a typeahead or something I'd do something like: //get DOM element const input = document.getEle...

Open Graph Description: Not sure this is a good idea, or even possible, but thought I'd throw it out there. In vanilla Rx, if I wanted to listen to a DOM event to do a typeahead or something I'd do something like: //get D...

X Description: Not sure this is a good idea, or even possible, but thought I'd throw it out there. In vanilla Rx, if I wanted to listen to a DOM event to do a typeahead or something I'd do something like:...

Opengraph URL: https://github.com/angular/angular/issues/4062

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: Support declarative binding from View events to Observables","articleBody":"Not sure this is a good idea, or even possible, but thought I'd throw it out there.\r\n\r\nIn vanilla Rx, if I wanted to listen to a DOM event to do a typeahead or something I'd do something like:\r\n\r\n``` js\r\n//get DOM element\r\nconst input = document.getElementById('myInput');\r\n//observable of click events\r\nconst inputs$ = Rx.Observable.fromEvent(input, 'keyup');\r\n//map changes to requests\r\nconst responses$ = inputs$.flatMap(ev => myHttpService.get(ev.target.value)); \r\n//subscribe to responses\r\nresponses$.subscribe(json => console.log(json));\r\n```\r\n\r\nIn current ng2, if I wanted to do the equivalent, I'd do something like:\r\n\r\n``` js\r\n@Component({\r\n  selector: 'my-component'\r\n})\r\n@View({\r\n  template: `\r\n     \u003cdiv [ng-form-model]=\"myForm\">\r\n       \u003cinput type=\"text\" ng-control=\"query\">\r\n    \u003c/div>\r\n    \u003cul>\r\n     \u003cli *ng-for=\"#result of results | async\">{{result.text}}\u003c/li>\r\n   \u003c/ul>\r\n`\r\n})\r\nclass MyComponent {\r\n  constructor(public http: Http, fb: FormBuilder){\r\n    //create form group\r\n    this.myForm = fb.group({\r\n      query: \"\"\r\n    });\r\n    //subscribe to value changes, map to responses, bind to view w/ pipe\r\n    this.results = this.myForm.controls.query.valueChanges\r\n      .toRx()\r\n      .flatMap(query => this.http.get(`/foos?q=${query}`)\r\n      .map(res => res.json());\r\n  }\r\n}\r\n```\r\n\r\nThis all works great (or will, once Rx stuff settles).\r\n\r\nHowever, if I wanted to do the same sort of thing from an arbitrary event (unrelated to forms, like a mousedrag or button click or whatever), there's not a good way (I can see) to get an Observable from a DOM event, so you have to do something like:\r\n\r\n``` html\r\n\u003cbutton (click)=\"makeRequest($event)\">Make Request\u003c/button>\r\n```\r\n\r\n``` js\r\n//snip\r\nclass MyComponent {\r\n  makeRequest($event){\r\n    this.http.get($event.target.url)\r\n      .map(res => res.json())\r\n      .subscribe(results => this.results = results);\r\n  }\r\n}\r\n```\r\n\r\nwhich isn't nearly as clean.\r\n\r\nProposed idea would be to provide a way to delegate / bind an arbitrary DOM event to a Subject/Observable, so that it could be easily subscribed to and handled reactively. \r\n\r\n~~Something like (totally made up syntax here, point being we're binding the click event to the Subject):~~\r\n\r\nEdit: see https://github.com/angular/angular/issues/4062#issuecomment-231615401 for current proposal\r\n\r\n``` html\r\n\u003cbutton [(click)]=\"clicks$\">make request\u003c/button>\r\n```\r\n\r\n``` js\r\nclass MyComponent {\r\n  clicks$ = new Rx.Subject();\r\n  constructor(){\r\n    this.results = this.clicks$\r\n      .flatMap(ev => http.get('someurl.json'))\r\n      .map(res => res.json())\r\n  }\r\n}\r\n```\r\n\r\nI saw https://github.com/angular/angular/pull/3992, but I believe this is for emitting events \"out\" from the component, whereas this idea is more for usage within a component.\r\n\r\nThoughts?\r\n","author":{"url":"https://github.com/robwormald","@type":"Person","name":"robwormald"},"datePublished":"2015-09-08T23:48:26Z","url":"https://github.com/angular/angular/issues/4062"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0fc0ba48-117c-0bd0-050c-9ca3ee6ef959
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB94E:27D3AD:1BCE8E2:2345724:6B0152AB
html-safe-nonced3d2ed69938bdb7749269641396169981c3b18d6bbda4f816d0a26bf104a942c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTRFOjI3RDNBRDoxQkNFOEUyOjIzNDU3MjQ6NkIwMTUyQUIiLCJ2aXNpdG9yX2lkIjoiNjE4MDY5MDU5MDUyNzczODUzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc46b10385e78fa40c42b293b3b4f4693b0e04cc8b0a1fcf89d3579ddb45eb47e
hovercard-subject-tagissue:105490360
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/4062/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9fd27defc33c3105f6d5bf59abd3c90c31d3992e92c72088499c554eb250f829/angular/angular/issues/4062
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9fd27defc33c3105f6d5bf59abd3c90c31d3992e92c72088499c554eb250f829/angular/angular/issues/4062
og:image:altNot sure this is a good idea, or even possible, but thought I'd throw it out there. In vanilla Rx, if I wanted to listen to a DOM event to do a typeahead or something I'd do something like: //get D...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerobwormald
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/4062#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F4062
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F4062
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/4062
Reloadhttps://github.com/angular/angular/issues/4062
Reloadhttps://github.com/angular/angular/issues/4062
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/4062
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/4062
Proposal: Support declarative binding from View events to Observableshttps://github.com/angular/angular/issues/4062#top
https://github.com/robwormald
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
effort2: dayshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22effort2%3A%20days%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
state: Needs Designhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20Needs%20Design%22
https://github.com/robwormald
robwormaldhttps://github.com/robwormald
on Sep 8, 2015https://github.com/angular/angular/issues/4062#issue-105490360
#4062 (comment)https://github.com/angular/angular/issues/4062#issuecomment-231615401
#3992https://github.com/angular/angular/pull/3992
Nexthttps://github.com/angular/angular/issues/4062?timeline_page=1
https://github.com/PatrickJS
PatrickJShttps://github.com/PatrickJS
on Sep 9, 2015https://github.com/angular/angular/issues/4062#issuecomment-138735440
https://tipe.io?ref=github-comment
https://github.com/dsebastien
dsebastienhttps://github.com/dsebastien
on Sep 9, 2015https://github.com/angular/angular/issues/4062#issuecomment-138777361
mheveryhttps://github.com/mhevery
state: Needs Designhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20Needs%20Design%22
on Sep 28, 2015https://github.com/angular/angular/issues/4062#event-421268583
jeffbcrosshttps://github.com/jeffbcross
robwormaldhttps://github.com/robwormald
on Sep 29, 2015https://github.com/angular/angular/issues/4062#event-422075113
https://github.com/jeffbcross
jeffbcrosshttps://github.com/jeffbcross
on Oct 29, 2015https://github.com/angular/angular/issues/4062#issuecomment-152360414
@vsavkinhttps://github.com/vsavkin
https://github.com/ericmartinezr
ericmartinezrhttps://github.com/ericmartinezr
on Oct 30, 2015https://github.com/angular/angular/issues/4062#issuecomment-152361332
@jeffbcrosshttps://github.com/jeffbcross
jeffbcrosshttps://github.com/jeffbcross
comp: data-accesshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22comp%3A%20data-access%22
on Oct 30, 2015https://github.com/angular/angular/issues/4062#event-450474033
https://github.com/flyingmutant
flyingmutanthttps://github.com/flyingmutant
on Nov 16, 2015https://github.com/angular/angular/issues/4062#issuecomment-157027635
https://github.com/flyingmutant
flyingmutanthttps://github.com/flyingmutant
on Nov 16, 2015https://github.com/angular/angular/issues/4062#issuecomment-157029159
https://github.com/0x-r4bbit
0x-r4bbithttps://github.com/0x-r4bbit
on Nov 29, 2015https://github.com/angular/angular/issues/4062#issuecomment-160414241
@jeffbcrosshttps://github.com/jeffbcross
@vsavkinhttps://github.com/vsavkin
@robwormaldhttps://github.com/robwormald
@ericmartinezrhttps://github.com/ericmartinezr
https://github.com/danculley
danculleyhttps://github.com/danculley
on Dec 22, 2015https://github.com/angular/angular/issues/4062#issuecomment-166716773
@PascalPrechthttps://github.com/PascalPrecht
https://github.com/thelgevold
thelgevoldhttps://github.com/thelgevold
on Dec 31, 2015https://github.com/angular/angular/issues/4062#issuecomment-168113268
https://github.com/edispring
edispringhttps://github.com/edispring
on Jan 18, 2016https://github.com/angular/angular/issues/4062#issuecomment-172535747
https://github.com/valorkin
valorkinhttps://github.com/valorkin
on Jan 19, 2016https://github.com/angular/angular/issues/4062#issuecomment-172852244
https://github.com/mhevery
mheveryhttps://github.com/mhevery
on Jan 27, 2016https://github.com/angular/angular/issues/4062#issuecomment-175912618
https://github.com/mgechev
mgechevhttps://github.com/mgechev
on Jul 14, 2016https://github.com/angular/angular/issues/4062#issuecomment-232604548
@gdi2290https://github.com/gdi2290
mheveryhttps://github.com/mhevery
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
comp: corehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22comp%3A%20core%22
on Sep 7, 2016https://github.com/angular/angular/issues/4062#event-781549324
IgorMinarhttps://github.com/IgorMinar
P3: importanthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P3%3A%20important%22
on Oct 4, 2016https://github.com/angular/angular/issues/4062#event-812178513
https://github.com/fxck
fxckhttps://github.com/fxck
on Oct 6, 2016https://github.com/angular/angular/issues/4062#issuecomment-252010466
https://github.com/PatrickJS
PatrickJShttps://github.com/PatrickJS
on Oct 10, 2016https://github.com/angular/angular/issues/4062#issuecomment-252522679
https://tipe.io?ref=github-comment
https://github.com/fxck
fxckhttps://github.com/fxck
on Oct 10, 2016https://github.com/angular/angular/issues/4062#issuecomment-252561225
https://github.com/otodockal
otodockalhttps://github.com/otodockal
on Oct 10, 2016https://github.com/angular/angular/issues/4062#issuecomment-252566184
@fxckhttps://github.com/fxck
https://github.com/AngularClass/angular2-observe-decoratorshttps://github.com/AngularClass/angular2-observe-decorators
https://github.com/amcdnl
amcdnlhttps://github.com/amcdnl
on Nov 8, 2016https://github.com/angular/angular/issues/4062#issuecomment-259133568
@robwormaldhttps://github.com/robwormald
@IgorMinarhttps://github.com/IgorMinar
@gdi2290https://github.com/gdi2290
angular2-data-tablehttps://github.com/swimlane/angular2-data-table
Codehttps://github.com/swimlane/angular2-data-table/blob/master/src/components/header/header.component.ts#L11-L41
https://camo.githubusercontent.com/a9b8bdf8340445508aa3d27db446c57a496db515397a1085859841948aae0f62/687474703a2f2f636f6e74656e742e73637265656e636173742e636f6d2f75736572732f616d6364616e69656c32322f666f6c646572732f536e616769742f6d656469612f37333137633430312d343061382d346136362d623937662d3962666139613863336662652f323031362d31312d30385f30382d30392d35382e706e67
@gdi2290https://github.com/gdi2290
https://github.com/PatrickJS
PatrickJShttps://github.com/PatrickJS
on Dec 17, 2016https://github.com/angular/angular/issues/4062#issuecomment-267764096
#13248https://github.com/angular/angular/issues/13248
https://tipe.io?ref=github-comment
https://github.com/amcdnl
amcdnlhttps://github.com/amcdnl
on Dec 19, 2016https://github.com/angular/angular/issues/4062#issuecomment-267963423
@gdi2290https://github.com/gdi2290
https://github.com/mhevery
mheveryhttps://github.com/mhevery
on Dec 20, 2016https://github.com/angular/angular/issues/4062#issuecomment-268123959
#13248https://github.com/angular/angular/issues/13248
mheveryhttps://github.com/mhevery
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 20, 2016https://github.com/angular/angular/issues/4062#event-899468122
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 13, 2019https://github.com/angular/angular/issues/4062#issuecomment-531092598
automatic conversation locking policyhttps://github.com/angular/angular/blob/67d80f/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 13, 2019https://github.com/angular/angular/issues/4062#event-2631162708
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/4062
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/4062
robwormaldhttps://github.com/robwormald
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
effort2: dayshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22effort2%3A%20days%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
state: Needs Designhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20Needs%20Design%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.