I recently tried implementing a solution from an article () to pass an ID between modules in order to use it as a search filter. However, I encountered the "cannot match any routes" error and have been struggling for some time since I'm new to Angular and unsure of what mistakes I might be making.
Error Log
core.js:6014 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'municipality/%5B'./municipalityListDep',department.code%5D'
Error: Cannot match any routes. URL Segment: 'municipality/%5B'./municipalityListDep',department.code%5D'
at ApplyRedirects.noMatchError (router.js:4295)
at CatchSubscriber.selector (router.js:4259)
at CatchSubscriber.error (catchError.js:29)
at MapSubscriber._error (Subscriber.js:75)
at MapSubscriber.error (Subscriber.js:55)
... // Error log continuation
municipality-listdep.component.ts
import { Component, OnInit } from '@angular/core';
import {ActivatedRoute} from '@angular/router';
... // Code continuation
municipality.component.html
<h1>Municipios</h1>
<br />
<br />
... // HTML code continuation
municipality.component.ts
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
... // Code continuation
municipality-routing.module.ts
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
... // Code continuation