Could this be a bug or a specification that I can't seem to find in Angular 5? When I use routerLink in the following way:
<button routerLink="/account/order/{{this.orderService.order._id}}/messages">Messages</button>
Everything works fine and I can navigate to the URL
/account/order/5aaaa0c6fd204609b3bd2577/messages
in my component.
However, when I inspect it in Chrome DevTools (and I also tried in Firefox), I notice a discrepancy:
<button _ngcontent-c4="" class="btn" tabindex="0" ng-reflect-router-link="/account/order/5aaaa0c6fd20460">Messages</button>
I have attempted using different methods for routerLink, but the issue persists with the URL being truncated (I even tried creating the URL string in the component.ts file and passing it as a variable to routerLink). Initially, it seems like there is a limit to the length of ng-reflect-router-link
.
Yet, when I use a simple string in the href attribute, the DevTools display the link normally like this:
<button _ngcontent-c4="" class="btn" routerlink="/123456789123456789123456789123456789123456789123456789123456789" tabindex="0" ng-reflect-router-link="/12345678912345678912345678912">Messages</button>
Does anyone know why the actual href is being cut off? Is this a known behavior documented anywhere or is this potentially a bug that needs to be reported on the GitHub Angular repository?