Router's navigate() throws exception for component has no route config (in Alpha 38)
See original GitHub issueJust tried alpha 38 … found a few minor things, but this one is confusing on the router. We can now use navigate
or navigateByUrl
/ The latter accepts a string (the old style) and works. The former accepts a tuple, and tosses an error at me.
// this works
this._router.navigateByUrl(`detail/${this.selectedHero.id}`);
// this does not work
this._router.navigate([`./${Routes.detail.as}`, {id: this.selectedHero.id}]);
The error is ORIGINAL EXCEPTION: Component "HeroesComponent" has no route config.
See example here
https://github.com/johnpapa/angular2-tour-of-heroes/blob/master/src/app/heroes.component.ts#L38-L39
cc/ @btford:
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Component has no route config. in Component - Angular 2 ...
You're bootstraping the wrong component. Your root component is LoginComponent therefore when you write /SomeComponent (absolute path) it will start from ...
Read more >48 answers on StackOverflow to the most popular Angular ...
Angular EXCEPTION: No provider for Http; Can't bind to 'formGroup' ... The router will remove this component from the DOM and destroy it....
Read more >export 'useroutematch' (imported as 'useroutematch') was not found ...
however, I get this error: export 'useNavigation' (imported as 'useNavigation') was not found in 'react-router-dom' (possible exports: BrowserRouter, ...
Read more >Attribute Routing in ASP.NET Web API 2 | Microsoft Learn
This topic discusses how to enable attribute routing in ASP.NET Web API 2 and describes various options for attribute routing.
Read more >Router tutorial: tour of heroes - Angular
Configure the router module with RouterModule.forRoot(); Set the router to compose HTML5 browser URLs; Handle invalid routes with a wildcard route; Navigate to ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes–
/
means relative to the root of the application, and./
means a child of this component.So this is expected behavior, but the exception here could be a bit better.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.