René's URL Explorer Experiment


Title: canLoad guard does not subscribe to Observable · Issue #18991 · angular/angular · GitHub

Open Graph Title: canLoad guard does not subscribe to Observable · Issue #18991 · angular/angular

X Title: canLoad guard does not subscribe to Observable · Issue #18991 · angular/angular

Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here...

Open Graph Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Feature request [ ] Documentation issue or request [ ] Support request => P...

X Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Feature request [ ] Documentation issue or request [ ] Support request ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"canLoad guard does not subscribe to Observable\u003cboolean>","articleBody":"## I'm submitting a...\r\n\u003c!-- Check one of the following options with \"x\" -->\r\n\u003cpre>\u003ccode>\r\n[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[x] Bug report\r\n[ ] Feature request\r\n[ ] Documentation issue or request\r\n[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n\u003c/code>\u003c/pre>\r\n\r\n## Current behavior\r\nWhen passing an Observable to the `canLoad` guard for a lazyly loaded module `routerLink` stops navigating to any route even if the boolean in `Observable\u003cboolean>` is `true`. **No** error messages in console.\r\n\r\n**app-routing.module**:\r\n```typescript\r\nconst routes: Routes = [\r\n  {\r\n    path: '',\r\n    component: SomeAComponent,\r\n    pathMatch: 'full'\r\n  },\r\n  {\r\n    path: 'someb',\r\n    component: SomeBComponent,\r\n    canActivate: [\r\n      AuthGuard\r\n    ],\r\n  },\r\n  {\r\n    path: 'lazy',\r\n    loadChildren: './lazy/lazy.module#LazyModule',\r\n    canLoad: [\r\n      AuthGuard\r\n    ]\r\n  },\r\n  {\r\n    path: '**',\r\n    redirectTo: '/'\r\n  }\r\n];\r\n```\r\n\r\n**auth.guard**:\r\n```typescript\r\n@Injectable()\r\nexport class AuthGuard implements CanLoad, CanActivate {\r\n\r\n  /* \r\n   * @angular-redux/store\r\n   * false --> next() --> true --> ...\r\n   */\r\n  @select() readonly authenticated$: Observable\u003cboolean>;\r\n\r\n  canLoad(): Observable\u003cboolean> | boolean {\r\n    // return true; // WORKS\r\n    return this.authenticated$; // ERROR: all routing stops from and to the current page\r\n  }\r\n\r\n  canActivate(): Observable\u003cboolean> | boolean {\r\n    // return true; // WORKS\r\n    return this.authenticated$; // WORKS\r\n  }\r\n\r\n}\r\n```\r\n\r\n**lazy-routing.module**:\r\n```typescript\r\n//...\r\nconst routes: Routes = [\r\n  {\r\n    path: '',\r\n    component: LazyComponent\r\n  }\r\n];\r\n//...\r\n```\r\n\r\n## Expected behavior\r\nLike the `canActivate` guard the `canLoad`guard should subscribe to the Observable.\r\n\r\n\r\n## Minimal reproduction of the problem with instructions\r\n* set value of the `authenticated$` Observable to true\r\n* lazy load a module and protect it via `canLoad` guard\r\n* navigate to the lazy and protected module via `\u003ca routerLink=\"/lazy\">Lazy\u003c/a>`\r\n=> **all** navigation stops.\r\n\r\n## Environment\r\n\r\n\u003cpre>\u003ccode>\r\nAngular version: 4.3.6\r\n\u003c!-- Check whether this is still an issue in the most recent Angular version -->\r\n\r\nBrowser:\r\n- [x] Chrome (desktop) version 60.0.3112.113\r\n- [ ] Chrome (Android) version XX\r\n- [ ] Chrome (iOS) version XX\r\n- [x] Firefox version 55.0.3\r\n- [x] Safari (desktop) version 10.1.2 (12603.3.8)\r\n- [ ] Safari (iOS) version XX\r\n- [ ] IE version XX\r\n- [ ] Edge version XX\r\n \r\nFor Tooling issues:\r\n- Node version: v8.4.0\r\n- Platform:  MacOS 10.12.6\r\n\r\nOthers:\r\n* @angular-redux/router@6.3.1\r\n* @angular-redux/store@6.5.7\r\n* redux@3.7.2\r\n* rxjs@5.4.3\r\n* typescript@2.3.4\r\n\u003c/code>\u003c/pre>\r\n","author":{"url":"https://github.com/markusfalk","@type":"Person","name":"markusfalk"},"datePublished":"2017-09-01T08:46:31Z","url":"https://github.com/angular/angular/issues/18991"}

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:507d3028-e0b8-fa14-062e-971291ee29a1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idED84:21E3E7:CA7EE1:10C80E7:6B00F641
html-safe-nonce364d63273a2d926e86bda09d91cbe5b11e46c6e8e9c58732ad6879f9520cb089
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDg0OjIxRTNFNzpDQTdFRTE6MTBDODBFNzo2QjAwRjY0MSIsInZpc2l0b3JfaWQiOiI3NDMxOTIyNzAyNTM5MDkzNTY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac31c3d7013267668e4e67357dfaf42e3cf7fbb2b8e88dd35dddeed8ef7e5d939c
hovercard-subject-tagissue:254575385
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/18991/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c2b1a2860154778d0afb37600dc4cf21c62f2e432a3454745425ccd5bf3c6579/angular/angular/issues/18991
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c2b1a2860154778d0afb37600dc4cf21c62f2e432a3454745425ccd5bf3c6579/angular/angular/issues/18991
og:image:altI'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Feature request [ ] Documentation issue or request [ ] Support request => P...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemarkusfalk
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
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
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/18991#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F18991
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%2F18991
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/18991
Reloadhttps://github.com/angular/angular/issues/18991
Reloadhttps://github.com/angular/angular/issues/18991
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)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/18991
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/18991
canLoad guard does not subscribe to Observablehttps://github.com/angular/angular/issues/18991#top
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
https://github.com/markusfalk
markusfalkhttps://github.com/markusfalk
on Sep 1, 2017https://github.com/angular/angular/issues/18991#issue-254575385
Nexthttps://github.com/angular/angular/issues/18991?timeline_page=1
https://github.com/zhantewei2
zhantewei2https://github.com/zhantewei2
on Sep 1, 2017https://github.com/angular/angular/issues/18991#issuecomment-326540324
@angular-reduxhttps://github.com/angular-redux
https://github.com/trotyl
trotylhttps://github.com/trotyl
on Sep 1, 2017https://github.com/angular/angular/issues/18991#issuecomment-326542298
https://github.com/markusfalk
markusfalkhttps://github.com/markusfalk
on Sep 1, 2017https://github.com/angular/angular/issues/18991#issuecomment-326547274
https://github.com/trotyl
trotylhttps://github.com/trotyl
on Sep 1, 2017https://github.com/angular/angular/issues/18991#issuecomment-326565072
https://github.com/markusfalk
markusfalkhttps://github.com/markusfalk
on Sep 1, 2017https://github.com/angular/angular/issues/18991#issuecomment-326581141
http://plnkr.co/edit/mo9tdwBXQJBMj5ZR2YCbhttp://plnkr.co/edit/mo9tdwBXQJBMj5ZR2YCb
https://github.com/Toxicable
Toxicablehttps://github.com/Toxicable
on Sep 2, 2017https://github.com/angular/angular/issues/18991#issuecomment-326770757
StackOverflowhttp://stackoverflow.com/
check out this explanationhttps://github.com/angular/angular/blob/master/CONTRIBUTING.md#-got-a-question-or-problem
https://github.com/markusfalk
markusfalkhttps://github.com/markusfalk
on Sep 4, 2017https://github.com/angular/angular/issues/18991#issuecomment-326875930
@Toxicablehttps://github.com/Toxicable
https://github.com/markusfalk
markusfalkhttps://github.com/markusfalk
on Sep 4, 2017https://github.com/angular/angular/issues/18991#issuecomment-326996472
https://stackoverflow.com/questions/46040890/why-do-angular-guards-behave-differently-when-using-select-from-angular-reduxhttps://stackoverflow.com/questions/46040890/why-do-angular-guards-behave-differently-when-using-select-from-angular-redux
https://github.com/0xclx
0xclxhttps://github.com/0xclx
on Sep 5, 2017https://github.com/angular/angular/issues/18991#issuecomment-327142148
https://gitlab.com/scaks/myTestApphttps://gitlab.com/scaks/myTestApp
https://github.com/Toxicable
Toxicablehttps://github.com/Toxicable
on Sep 5, 2017https://github.com/angular/angular/issues/18991#issuecomment-327147686
http://plnkr.co/edit/BjbIT1ProJhV9LZycvGn?p=previewhttp://plnkr.co/edit/BjbIT1ProJhV9LZycvGn?p=preview
https://github.com/0xclx
0xclxhttps://github.com/0xclx
on Sep 5, 2017https://github.com/angular/angular/issues/18991#issuecomment-327148995
http://plnkr.co/edit/p87Ngq4QBXyDMhhNilv4?p=previewhttp://plnkr.co/edit/p87Ngq4QBXyDMhhNilv4?p=preview
https://github.com/Toxicable
Toxicablehttps://github.com/Toxicable
on Sep 5, 2017https://github.com/angular/angular/issues/18991#issuecomment-327151035
@Z3roCoderhttps://github.com/Z3roCoder
@markusfalkhttps://github.com/markusfalk
https://github.com/0xclx
0xclxhttps://github.com/0xclx
on Sep 5, 2017https://github.com/angular/angular/issues/18991#issuecomment-327151436
http://plnkr.co/edit/n0blzfQNPAp3v5tQGWRR?p=previewhttp://plnkr.co/edit/n0blzfQNPAp3v5tQGWRR?p=preview
https://github.com/Toxicable
Toxicablehttps://github.com/Toxicable
on Sep 5, 2017https://github.com/angular/angular/issues/18991#issuecomment-327151870
https://github.com/0xclx
0xclxhttps://github.com/0xclx
on Sep 5, 2017https://github.com/angular/angular/issues/18991#issuecomment-327152590
IgorMinarhttps://github.com/IgorMinar
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
on Sep 20, 2017https://github.com/angular/angular/issues/18991#event-1256571347
https://github.com/bunnyvishal6
bunnyvishal6https://github.com/bunnyvishal6
on Dec 3, 2017https://github.com/angular/angular/issues/18991#issuecomment-348814935
https://github.com/ghetolay
ghetolayhttps://github.com/ghetolay
on Dec 4, 2017https://github.com/angular/angular/issues/18991#issuecomment-348924304
@bunnyvishal6https://github.com/bunnyvishal6
https://github.com/bunnyvishal6
bunnyvishal6https://github.com/bunnyvishal6
on Dec 4, 2017https://github.com/angular/angular/issues/18991#issuecomment-348940039
@ghetolayhttps://github.com/ghetolay
jasonadenhttps://github.com/jasonaden
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 5, 2017https://github.com/angular/angular/issues/18991#event-1373777283
ghetolayhttps://github.com/ghetolay
on Jan 16, 2018https://github.com/angular/angular/issues/18991#event-1427211090
fix(router): add consistency between guardshttps://github.com/ghetolay/angular/commit/768ab39d49b0fd0f12bb9bb4df36b93b93120a4c
https://docs.github.com/articles/closing-issues-via-commit-messages
768ab39https://github.com/ghetolay/angular/commit/768ab39d49b0fd0f12bb9bb4df36b93b93120a4c
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 12, 2019https://github.com/angular/angular/issues/18991#issuecomment-531042879
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 12, 2019https://github.com/angular/angular/issues/18991#event-2630825341
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/18991
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/18991
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%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.