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
I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v4.x
v5.x
v6.x
Current Behavior
If I use routerLink with value null, I get console error.
<ion-item [routerLink]="null"></ion-item>
Error
core.mjs:6449
ERROR TypeError: Cannot read properties of null (reading 'root')
at DefaultUrlSerializer.serialize (router.mjs:878:51)
at Router.serializeUrl (router.mjs:4757:35)
at RouterLinkDelegateDirective.updateTargetUrlAndHref (ionic-angular.js:3764:79)
at RouterLinkDelegateDirective.ngOnInit (ionic-angular.js:3752:14)
at callHook (core.mjs:2518:1)
at callHooks (core.mjs:2487:1)
at executeInitAndCheckHooks (core.mjs:2438:1)
at selectIndexInternal (core.mjs:8368:1)
at ɵɵadvance (core.mjs:8351:1)
I think it has something to do with:
You can now disable the navigation of a routerLink by passing undefined and null. Previously the routerLink directive used to accept these two values as equivalent to an empty string.
@marcovmun thanks for reporting this. I don't believe we've updated our internal RouterLinkDelegate to support that new feature change in v13 of Angular.
I'll need to look into all aspects of what assigning null to the routerLink includes, so that we have alignment with the expected implementation.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Prerequisites
Ionic Framework Version
Current Behavior
If I use routerLink with value null, I get console error.
Error
I think it has something to do with:
https://update.angular.io/?l=3&v=12.0-13.0
Expected Behavior
No error is visible in console and routerlink is disabled.
Steps to Reproduce
Code Reproduction URL
No response
Ionic Info
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: