-
-
Notifications
You must be signed in to change notification settings - Fork 40.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(roadmap/angular): add more resources about angular routing (#6089)
- Loading branch information
Showing
4 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/data/roadmaps/angular/content/107-routing/100-configuration.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,23 @@ | ||
# Configuration | ||
|
||
The configuration of routes in an Angular application involves defining route mappings in an array and providing these routes to the Angular router. | ||
|
||
### Example routes: | ||
```typescript | ||
const appRoutes: Routes = [ | ||
{ path: 'custom-path', component: CustomComponet }, | ||
{ path: 'custom-path/:id', component: CustomDetailComponet, data: { title: 'Details component' } }, | ||
{ path: '', redirectTo: '/heroes', pathMatch: 'full'}, | ||
{ path: '**', component: PageNotFoundComponent } | ||
]; | ||
``` | ||
|
||
- `'custom-path'`: defining a new url route. | ||
- `'custom-path/:id'` defining _**id**_ parameter. | ||
- `''` (empty path): instantiate a component without the need for defining a new url route. | ||
- `'**'`: for undefined paths. | ||
- The `data` property in the second route is a place to store arbitrary data associated with this specific route. | ||
|
||
Visit the following resources to learn more: | ||
|
||
- [@official@Router reference - Configuration](https://angular.dev/guide/routing/router-reference#configuration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters