5

https://github.com/Wilkuuu/Biblio

In Books component in html i`ve :

<a 
  routerLink="/books/{{book.id}}" 
  class="btn btn-secondary btn-sm">
  <i class="fa fa-file"></i>
</a>

in app-routing :

{ path: 'book/:id', component: BookDetailComponent }

In URL i see an id from firebase, but the path provides me to :

{ path: '**' , component: NotfoundComponent },
SiddAjmera
  • 38,129
  • 5
  • 72
  • 110
Arek Szumacher
  • 348
  • 1
  • 4
  • 14

2 Answers2

3

Just have a look at your route config:

{ path: 'book/:id', component: BookDetailComponent }

The route that you should be using is book/ and not books/

routerLink="/books/{{book.id}}"

should be

routerLink="/book/{{book.id}}"

And yeah, as mentioned by Andrei, the catch-all route(the one with path: '**') should be the last route in your route config.

SiddAjmera
  • 38,129
  • 5
  • 72
  • 110
0

Ofc problem solved. {path: '**' , component: NotfoundComponent}, must be the last one. Ty !

Arek Szumacher
  • 348
  • 1
  • 4
  • 14