I'm trying to route a link to a page in my Angular application, but always receive the same error.
My Route.ts file has these routes:
export const ROUTES : Routes = [
{path:'',component:AvisosComponent },
{path:'gerenciarModeloAviso', component:GerenciaModAvisoComponent },
{path:'editModeloAviso/:id/:action', component: EditModeloAvisoComponent }
]
The problem is in the last route, that has two parameters.
And in the html I tried this:
<img src="../assets/editarOn.png" alt="Editar" [routerLink]="['/editModeloAviso',estrut.idAvisoEstrutura,'VIEW']" />
Then, I tried this:
<img src="../assets/editarOn.png" alt="Editar" [routerLink]="['/editModeloAviso',{id:estrut.idAvisoEstrutura,action:'VIEW'}]" />
And the error are always the same:
Just for comment, I changed the route file to this:
export const ROUTES : Routes = [
{path:'',component:AvisosComponent },
{path:'gerenciarModeloAviso', component:GerenciaModAvisoComponent },
{path:'editModeloAviso/:id/action', component: EditModeloAvisoComponent }
]
( I removed the ":" before the "action" word. Anyway, the error persists. )
If I use just one parameter in the route, It's ok, i have no error. But with two, no way.
Could You help me ?
Thanks in advance.