You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
@jasonaden Are you saying there is a fix for this issue? I've loaded up the official example and still see "canLoad": [ null ] even though there is an AuthGuard set.
This is a docs issue, not a router issue. The logged null value is a result of how JSON.stringify() stringifies functions inside an array. In order to avoid confusion, one could use a custom replacer in JSON.stringify() that uses the function's name instead:
Activity
jasonaden commentedon Dec 12, 2017
The
AuthGuardshould be an injectable symbol, not a string. That should fix this issue.Karasuni commentedon Dec 13, 2017
@jasonaden Are you saying there is a fix for this issue? I've loaded up the official example and still see
"canLoad": [ null ]even though there is an AuthGuard set.gkalpak commentedon Dec 13, 2017
This is a
docsissue, not arouterissue. The loggednullvalue is a result of how JSON.stringify() stringifies functions inside an array. In order to avoid confusion, one could use a customreplacerin JSON.stringify() that uses the function's name instead:This should be changed in (probably with a explanatory comment):
angular/aio/content/examples/router/src/app/app.module.ts
Lines 52 to 54 in 8c52088
kapunahelewong commentedon Feb 23, 2018
@jenniferfell This issue needs an update in the example as well as the doc.
jenniferfell commentedon Apr 25, 2018
It looks like this has been resolved. The example now looks like the "expected behavior" above, only without the AuthGuard being a string:
path: 'admin',
loadChildren: 'app/admin/admin.module#AdminModule',
canLoad: [AuthGuard]
@brandonroberts @gkalpak @jasonaden What do you think? Can we close this as resolved? Thanks!
brandonroberts commentedon Apr 25, 2018
I'm still seeing the same behavior being logged to the console in the stackblitz example
brandonroberts commentedon Oct 8, 2018
Fixed via #20023
angular-automatic-lock-bot commentedon Sep 14, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.