ERROR Error: Uncaught (in Promise): Error: Cannot match any Routes

Asked

Viewed 1,262 times

0

I’m getting the following error when I try to edit the entered information [routerLink]:

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'info-details/b9boSVIpE6R6Pxg2h2xC'
Error: Cannot match any routes. URL Segment: 'info-details/b9boSVIpE6R6Pxg2h2xC'

Html:

<ion-item button [routerLink]="['/info-details', information.id]">

Infomation.service.ts:

import { Injectable } from '@angular/core';
import {AngularFirestore } from '@angular/fire/firestore';
import { WriteInformation } from '../interfaces/write-information';
import{map} from 'rxjs/operators';

  updateInformation(id : string, information : WriteInformation){
  return this.informationCollection.doc<WriteInformation> 
  (id).update(information);
  }
  • He’s saying he didn’t find the info-Details route

  • if I put only <ion-item button [routerLink]="['/info-Details']> works, but will create new information, and the goal is to edit, and when I put the information.id (I saw it in a tutorial and adapted it to what I wanted) it does not work and gives this error, so I think it is not the info-Details.

1 answer

0

Do you have any path specifying the path to the Detail?

For example:

    { path: "info-details", component: InfoComponent },
    { path: "info-details/:id", component: InfoDetailComponents }

and then in the routerLink you do the following

 routerLink="/info-details/{{information.id}}"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.