Passing parent component data to child via routerLink

Discussão em 'Angular' iniciado por Red Cricket, Fevereiro 27, 2025.

  1. Red Cricket

    Red Cricket Guest

    I have a parent component that has a this button in the html template:

    <button class="button" [routerLink]="['/modify-alias-detail']">Next</button>


    The above seems to work as I get the edit-alias-detail works! output. But I'd like to pass some data from the parent to the child component so I tried this:

    <button class="button" [routerLink]="['/modify-alias-detail', aliasName.value]">Next</button>


    I get this error in the developer console:

    EXCEPTION: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'modify-alias-detail//'


    I haven't used routerLinks before and I am rather new to Angular 2.

    Continue reading...

Compartilhe esta Página