Title: $location.search() returns undefined when base href does not match URL · Issue #16241 · angular/angular.js · GitHub
Open Graph Title: $location.search() returns undefined when base href does not match URL · Issue #16241 · angular/angular.js
X Title: $location.search() returns undefined when base href does not match URL · Issue #16241 · angular/angular.js
Description: I'm submitting a ... bug report Current behavior: In our app's run function, $location.search() returns undefined. Expected / new behavior: $location.search() should return an object, as documented. Minimal reproduction of the problem wi...
Open Graph Description: I'm submitting a ... bug report Current behavior: In our app's run function, $location.search() returns undefined. Expected / new behavior: $location.search() should return an object, as documented...
X Description: I'm submitting a ... bug report Current behavior: In our app's run function, $location.search() returns undefined. Expected / new behavior: $location.search() should return an object, as do...
Opengraph URL: https://github.com/angular/angular.js/issues/16241
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"$location.search() returns undefined when base href does not match URL","articleBody":"**I'm submitting a ...**\r\n\u003c!-- (check one with \"x\") -->\r\n- [x] bug report\r\n\r\n**Current behavior:**\r\n\r\nIn our app's `run` function, `$location.search()` returns `undefined`.\r\n\r\n**Expected / new behavior:**\r\n`$location.search()` should return an object, as documented.\r\n\r\n\r\n**Minimal reproduction of the problem with instructions:**\r\n\r\nServe page at `https://localhost/foo/bar/`\r\n\r\ninclude tag `\u003cbase href=\"/baz/\">`\r\n\r\nUse HTML5 location mode.\r\n\r\nsee http://plnkr.co/edit/RRJMNjo6Viw1NbtNeWfr?p=preview\r\n\r\n**AngularJS version:** 1.5.10\r\n\r\n**Browser:** Chrome 61 | Firefox 57\r\n\r\n**Anything else:**\r\n\r\nOh, this may be a duplicate of #11223. That issue got sidetracked to a discussion of case-sensitivity and then marked as wontfix, but I think that was a tangent unrelated to making search() return properly.\r\n\r\nIn a way much like #14488 noted for $location.$$absUrl, the $location.$$search property may not be initialized before $location.search() is called.\r\n\r\nPerhaps the search() method needs to check to see if $$search is undefined, similar to how other functions check for a value for $$path or $$hash, or perhaps when $locationProvider.$get needs to *always* call $location.$$parse (which $location.$$parseLinkUrl declines to do in this condition).\r\n\r\nI also noticed that sometime *later* $location.search() would return properly; I suspect this is related to how $locationProvider.$get adds a watch to $rootScope, but the app's run function probably happens before that digest cycle.","author":{"url":"https://github.com/keturn","@type":"Person","name":"keturn"},"datePublished":"2017-09-25T01:33:00Z","url":"https://github.com/angular/angular.js/issues/16241"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:85a0c410-d8d5-d48c-ca7e-e615302af0ec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA40:1D05B8:2D20E4:3FDF1B:6AFE0511 |
| html-safe-nonce | 4c6dff02fc72a510f00700daf2db3ade6aa050fdcc2b254b871122070ccd7602 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTQwOjFEMDVCODoyRDIwRTQ6M0ZERjFCOjZBRkUwNTExIiwidmlzaXRvcl9pZCI6IjU5NzMyNDI3OTI5MzI4MTU1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 735528acd30210fddd32e0a4e2adb134659aad57cccadd8b46edbc7c8c926c56 |
| hovercard-subject-tag | issue:260132769 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular.js/16241/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e98423f67195a76674c26a5b12a5b4485cb18b3dccb639b40da6798e747a6f28/angular/angular.js/issues/16241 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e98423f67195a76674c26a5b12a5b4485cb18b3dccb639b40da6798e747a6f28/angular/angular.js/issues/16241 |
| og:image:alt | I'm submitting a ... bug report Current behavior: In our app's run function, $location.search() returns undefined. Expected / new behavior: $location.search() should return an object, as documented... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | keturn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 86d46ece7c3d9b0562692f81a135cb55ad6a1c82c93ab1ac874d2f1b46b28958 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular.js git https://github.com/angular/angular.js.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 460078 |
| octolytics-dimension-repository_nwo | angular/angular.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 460078 |
| octolytics-dimension-repository_network_root_nwo | angular/angular.js |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5c18e6799976b7bc2f21178024289bb98edbcc85 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width