I was reading the angular documentation and I came across this option:
From the ContainerComponent, you should be able to navigate to AComponent using the following routerLink, but it will not work if relativeLinkResolution is set to 'legacy':
<a [routerLink]="['./a']">Link to A</a>
However, this will work:
<a [routerLink]="['../a']">Link to A</a>
In other words, you're required to use ../ rather than ./ when the relative link resolution is set to 'legacy'.
From: https://angular.io/api/router/ExtraOptions#relativeLinkResolution
But my question is what is the difference between legacy and corrected? and what is the use of the legacy option, what use I can have by using ../ instead of ./ ?
As Markus Pscheidt said:
legacy
(how it used to be) = two dots to refer to same level.
corrected
(now default in Angular 11) = using a single dot to refer to same level.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With