I have a problem with my route system in my angular project. I receive this error each time I call the reset-password/:token
route.
every time I call this route, http://localhost:4200/reset-password?token=token_info
, the browser (google chrome) redirects me to http://localhost:4200/reset-password
and return this error message.
core.js:1673 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'reset-password' Error: Cannot match any routes. URL Segment: 'reset-password' at ApplyRedirects.push../node_modules/@angular/router/fesm5/router.js.ApplyRedirects.noMatchError (router.js:1384) at CatchSubscriber.selector (router.js:1365) at CatchSubscriber.push../node_modules/rxjs/_esm5/internal/operators/catchError.js.CatchSubscriber.error (catchError.js:34) at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:80) at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:60) at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:80) at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:60) at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._error (Subscriber.js:80) at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.error (Subscriber.js:60) at TapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/tap.js.TapSubscriber._error (tap.js:61) at resolvePromise (zone.js:814) at resolvePromise (zone.js:771) at zone.js:873 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:3811) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188) at drainMicroTaskQueue (zone.js:595)
On the other hand, all other roads operate
this is my code
app.module.ts
const appRoutes: Routes = [{
path: '',
component: LoginLayoutComponent,
children: [
{ path: '', component: SigninComponent },
{
path: 'forgot-password',
component: ForgotPasswordComponent,
},
{
path: 'forgot-password/confirmation',
component: ForgotPasswordConfirmationComponent,
},
{
path: 'reset-password/:token',
component: ResetPasswordComponent,
},
{ path: 'signup', component: SignupComponent },
{ path: 'logout', component: LogoutComponent, canActivate: [
CanActivateViaAuthGuard
]
},
]
},
please can you help me? thanks.
reset-password
route? Only areset-password/:token
route? – DeborahK