René's URL Explorer Experiment


Title: Passing in an a function to the ngOptions array clause that generates elements on the fly results in infinite $digest loop · Issue #9464 · angular/angular.js · GitHub

Open Graph Title: Passing in an a function to the ngOptions array clause that generates elements on the fly results in infinite $digest loop · Issue #9464 · angular/angular.js

X Title: Passing in an a function to the ngOptions array clause that generates elements on the fly results in infinite $digest loop · Issue #9464 · angular/angular.js

Description: AngularJS 1.2.22 (in particular, commit c286094) has changed the behaviour of ngOptions from deep watching to shallow watching the elements of the array. If the array and its elements are generated by a function on the fly, shallow watch...

Open Graph Description: AngularJS 1.2.22 (in particular, commit c286094) has changed the behaviour of ngOptions from deep watching to shallow watching the elements of the array. If the array and its elements are generated...

X Description: AngularJS 1.2.22 (in particular, commit c286094) has changed the behaviour of ngOptions from deep watching to shallow watching the elements of the array. If the array and its elements are generated...

Opengraph URL: https://github.com/angular/angular.js/issues/9464

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Passing in an a function to the ngOptions array clause that generates elements on the fly results in infinite $digest loop","articleBody":"AngularJS 1.2.22 (in particular, commit c2860944c61a0b910f703fe8a9717188ed387893) has changed the behaviour of ngOptions from deep watching to shallow watching the elements of the array. If the array and its elements are generated by a function on the fly, shallow watching will fail as even if the elements are identical, they are separate instances. This results in infinite $digest loops:\n\n```\n    Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!\n    Watchers fired in the last 5 iterations: [[\"fn: $watchCollectionWatch; newVal: 37; oldVal: 32\"],[\"fn: $watchCollectionWatch; newVal: 42; oldVal: 37\"],[\"fn: $watchCollectionWatch; newVal: 47; oldVal: 42\"],[\"fn: $watchCollectionWatch; newVal: 52; oldVal: 47\"],[\"fn: $watchCollectionWatch; newVal: 57; oldVal: 52\"]]\n    http://errors.angularjs.org/\"NG_VERSION_FULL\"/$rootScope/infdig?p0=10&p1=%5B%5B%22fn%3A%20%24watchCollectionWatch%3B%20newVal%3A%2037%3B%20oldVal%3A%2032%22%5D%2C%5B%22fn%3A%20%24watchCollectionWatch%3B%20newVal%3A%2042%3B%20oldVal%3A%2037%22%5D%2C%5B%22fn%3A%20%24watchCollectionWatch%3B%20newVal%3A%2047%3B%20oldVal%3A%2042%22%5D%2C%5B%22fn%3A%20%24watchCollectionWatch%3B%20newVal%3A%2052%3B%20oldVal%3A%2047%22%5D%2C%5B%22fn%3A%20%24watchCollectionWatch%3B%20newVal%3A%2057%3B%20oldVal%3A%2052%22%5D%5D\n        at /Users/tamas/build/github.com/drjokepu/angular.js/src/minErr.js:73:12\n        at Scope.$digest (/Users/tamas/build/github.com/drjokepu/angular.js/src/ng/rootScope.js:705:19)\n        at Scope.$apply (/Users/tamas/build/github.com/drjokepu/angular.js/src/ng/rootScope.js:931:24)\n        at null.\u003canonymous> (/Users/tamas/build/github.com/drjokepu/angular.js/test/ng/directive/selectSpec.js:1142:15)\n```\n\nA tracking expression clause is supported by ngOptions that explicitly defines the expression that is used for comparing array elements. However, currently this is only used for identifying the selected item and not used for watching the elements of the array itself. I am suggesting extending the usage of this expression to be also used for differentiating of the array items themselves when shallow watching.\n\n**Reproducible:** always\n**Browsers:** Tested on Chrome 37, Safari 7.1\n**Operating System:** OS X 10.9.5\n\nSteps to reproduce:\n- Create a new html file and add the following content:\n\n``` html\n\u003c!DOCTYPE html>\n\u003chtml>\n\u003chead>\n  \u003ctitle>Infinite Digest\u003c/title>\n\u003c/head>\n\u003cbody>\n  \u003cbody ng-app=\"demoApp\">\n    \u003cscript type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js\">\u003c/script>\n    \u003cscript type='text/javascript'>\n    angular.module('demoApp', []).controller('DemoController', function($scope) {\n      $scope.makeOptions = function() {\n          var options = [];\n          for (var i = 0; i \u003c 5; i++) {\n              options.push({ label: 'Value = ' + i, value: i });\n          }\n          return options;\n      };\n      $scope.selected = { label: 'Value = 1', value: 1 };\n    });\n    \u003c/script>\n    \u003cdiv ng-controller=\"DemoController\">\n        \u003cdiv>\n            \u003ch2>Infinite Digest\u003c/h2>\n            \u003cselect ng-model=\"selected\"\n                ng-options=\"opt as opt.label for opt in makeOptions() track by opt.value\">\n            \u003c/select>\n            The value selected is {{ selected.value }}.\n        \u003c/div>\n    \u003c/div>\n\u003c/body>\n\u003c/body>\n\u003c/html>\n```\n- Open this file in a browser. AngularJS will report infinite digest in the console.\n\nThis works fine on AngularJS 1.2.21 and earlier.\n\nI am not really an Angular developer (or a real JavaScript developer for that matter), but I am going to submit a pull request with a spec test as well as a proposed solution that will illustrate how I would go about tackling the issue,\n","author":{"url":"https://github.com/drjokepu","@type":"Person","name":"drjokepu"},"datePublished":"2014-10-07T15:35:31Z","url":"https://github.com/angular/angular.js/issues/9464"}

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:8435fcf2-d4d1-8e95-a4a1-a6cf6502e0c6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC538:37B940:337A0A:495BFA:6AFDE747
html-safe-nonce8ca3efa6abdf55a912cd0637be96ed72515fd18918fd7a33df17cdf78a7811ec
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTM4OjM3Qjk0MDozMzdBMEE6NDk1QkZBOjZBRkRFNzQ3IiwidmlzaXRvcl9pZCI6Ijc2NjU4NDk2OTgzMzgzMzQ1MzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac995c31816dba72713bdaee633e8359c7a1ca8e6860dfcba0e377b387a018c31c
hovercard-subject-tagissue:45122299
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.js/9464/issue_layout
twitter:imagehttps://opengraph.githubassets.com/86df669790573fc052618f289bead37838c90ccb218432e3198e4333cc6fab26/angular/angular.js/issues/9464
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/86df669790573fc052618f289bead37838c90ccb218432e3198e4333cc6fab26/angular/angular.js/issues/9464
og:image:altAngularJS 1.2.22 (in particular, commit c286094) has changed the behaviour of ngOptions from deep watching to shallow watching the elements of the array. If the array and its elements are generated...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedrjokepu
hostnamegithub.com
expected-hostnamegithub.com
None91ef1a291a064ac31ac459ab3f75261dbdd924c41ea5bd027e591c5b46cc9ce7
turbo-cache-controlno-preview
go-importgithub.com/angular/angular.js git https://github.com/angular/angular.js.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id460078
octolytics-dimension-repository_nwoangular/angular.js
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id460078
octolytics-dimension-repository_network_root_nwoangular/angular.js
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
released62bc98ce2346f4006e4a2810e9e22f37e7e6422
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular.js/issues/9464#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular.js%2Fissues%2F9464
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.js%2Fissues%2F9464
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.js
Reloadhttps://github.com/angular/angular.js/issues/9464
Reloadhttps://github.com/angular/angular.js/issues/9464
Reloadhttps://github.com/angular/angular.js/issues/9464
angularhttps://github.com/angular
angular.jshttps://github.com/angular/angular.js
Codehttps://github.com/angular/angular.js
Issues389 (389)https://github.com/angular/angular.js/issues
Pull requests72 (72)https://github.com/angular/angular.js/pulls
Actionshttps://github.com/angular/angular.js/actions
Projectshttps://github.com/angular/angular.js/projects
Wikihttps://github.com/angular/angular.js/wiki
Security and qualityhttps://github.com/angular/angular.js/security
Insightshttps://github.com/angular/angular.js/insights
https://github.com/angular/angular.js
Passing in an a function to the ngOptions array clause that generates elements on the fly results in infinite $digest loophttps://github.com/angular/angular.js/issues/9464#top
branch: 1.2.xhttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22branch%3A%201.2.x%22
component: formshttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22component%3A%20forms%22
Backlog - won't fixhttps://github.com/angular/angular.js/milestone/27
https://github.com/drjokepu
drjokepuhttps://github.com/drjokepu
on Oct 7, 2014https://github.com/angular/angular.js/issues/9464#issue-45122299
c286094https://github.com/angular/angular.js/commit/c2860944c61a0b910f703fe8a9717188ed387893
https://github.com/caitp
caitphttps://github.com/caitp
on Oct 7, 2014https://github.com/angular/angular.js/issues/9464#issuecomment-58205236
#9419https://github.com/angular/angular.js/pull/9419
caitphttps://github.com/caitp
component: formshttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22component%3A%20forms%22
branch: 1.2.xhttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22branch%3A%201.2.x%22
0 - Backloghttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%220%20-%20Backlog%22
on Oct 7, 2014https://github.com/angular/angular.js/issues/9464#event-175205167
caitphttps://github.com/caitp
on Oct 7, 2014https://github.com/angular/angular.js/issues/9464#event-175205369
caitphttps://github.com/caitp
0 - Backloghttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%220%20-%20Backlog%22
on Oct 7, 2014https://github.com/angular/angular.js/issues/9464#event-175205488
drjokepuhttps://github.com/drjokepu
on Oct 7, 2014https://github.com/angular/angular.js/issues/9464#event-175208137
fix(select): respect tracking expression when shallow watching arrays…https://github.com/drjokepu/angular.js/commit/476c87782329004bb30ef5ff965e778d254cf78c
https://docs.github.com/articles/closing-issues-via-commit-messages
476c877https://github.com/drjokepu/angular.js/commit/476c87782329004bb30ef5ff965e778d254cf78c
fix(select): respect tracking expression when shallow watching arrays…https://github.com/drjokepu/angular.js/commit/e3ca351855b14a1e8bd2e7e0a085f45dadff981c
https://docs.github.com/articles/closing-issues-via-commit-messages
e3ca351https://github.com/drjokepu/angular.js/commit/e3ca351855b14a1e8bd2e7e0a085f45dadff981c
fix(select): respect tracking expression when shallow watching arrays…https://github.com/drjokepu/angular.js/commit/f425223a7420071ea05aa9eeb128cc64834a0129
https://docs.github.com/articles/closing-issues-via-commit-messages
f425223https://github.com/drjokepu/angular.js/commit/f425223a7420071ea05aa9eeb128cc64834a0129
https://github.com/drjokepu
drjokepuhttps://github.com/drjokepu
on Oct 7, 2014https://github.com/angular/angular.js/issues/9464#issuecomment-58209839
petebacondarwinhttps://github.com/petebacondarwin
on Jan 11, 2015https://github.com/angular/angular.js/issues/9464#event-217147360
fix(ngOptions): prevent infinite digest if track by expression is stablehttps://github.com/petebacondarwin/angular.js/commit/6070d5b85c6f5adbd68b6d4a629fb81b19e52a2f
https://docs.github.com/articles/closing-issues-via-commit-messages
6070d5bhttps://github.com/petebacondarwin/angular.js/commit/6070d5b85c6f5adbd68b6d4a629fb81b19e52a2f
https://github.com/petebacondarwin
petebacondarwinhttps://github.com/petebacondarwin
on Jan 11, 2015https://github.com/angular/angular.js/issues/9464#issuecomment-69514797
#10639https://github.com/angular/angular.js/pull/10639
http://plnkr.co/edit/Q4EZDPCyAgUMKoWDPmrE?p=previewhttp://plnkr.co/edit/Q4EZDPCyAgUMKoWDPmrE?p=preview
petebacondarwinhttps://github.com/petebacondarwin
on Jan 12, 2015https://github.com/angular/angular.js/issues/9464#event-217619147
fix(ngOptions): prevent infinite digest if track by expression is stablehttps://github.com/petebacondarwin/angular.js/commit/4725ddbfe66cc78fa83490968c6d2b3e288e3fad
https://docs.github.com/articles/closing-issues-via-commit-messages
4725ddbhttps://github.com/petebacondarwin/angular.js/commit/4725ddbfe66cc78fa83490968c6d2b3e288e3fad
petebacondarwinhttps://github.com/petebacondarwin
completedhttps://github.com/angular/angular.js/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
fc21db8https://github.com/angular/angular.js/commit/fc21db8a15545fad53124fc941b3c911a8d57067
on Jan 12, 2015https://github.com/angular/angular.js/issues/9464#event-217620122
https://github.com/ipoly
ipolyhttps://github.com/ipoly
on May 12, 2015https://github.com/angular/angular.js/issues/9464#issuecomment-101232466
@petebacondarwinhttps://github.com/petebacondarwin
https://github.com/Narretz
Narretzhttps://github.com/Narretz
on Jun 5, 2015https://github.com/angular/angular.js/issues/9464#issuecomment-109266201
@ipolyhttps://github.com/ipoly
https://github.com/Jerryzhao-z
Jerryzhao-zhttps://github.com/Jerryzhao-z
on Oct 18, 2016https://github.com/angular/angular.js/issues/9464#issuecomment-254441360
@petebacondarwinhttps://github.com/petebacondarwin
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Oct 18, 2016https://github.com/angular/angular.js/issues/9464#issuecomment-254477423
@Jerryzhao-zhttps://github.com/Jerryzhao-z
http://plnkr.co/edit/krNb7CjrQ55i1LeOTJ91?p=previewhttp://plnkr.co/edit/krNb7CjrQ55i1LeOTJ91?p=preview
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular.js/issues/9464
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular.js/issues/9464
branch: 1.2.xhttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22branch%3A%201.2.x%22
component: formshttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22component%3A%20forms%22
Backlog - won't fixNo due datehttps://github.com/angular/angular.js/milestone/27
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.