Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jdegand/routerinput
Angular Challenges #22 router input solution
https://github.com/jdegand/routerinput
angular angular-challenges
Last synced: about 1 month ago
JSON representation
Angular Challenges #22 router input solution
- Host: GitHub
- URL: https://github.com/jdegand/routerinput
- Owner: jdegand
- Created: 2023-08-20T19:44:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-23T00:29:35.000Z (about 1 year ago)
- Last Synced: 2024-04-16T09:08:25.609Z (8 months ago)
- Topics: angular, angular-challenges
- Language: TypeScript
- Homepage:
- Size: 119 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RouterInput
[Thomas Laforge's Angular Challenges](https://github.com/tomalaforge/angular-challenges) (#22) router-input solution.
## Screenshots
![](screenshots/RouterInput.png)
## Built With
- [Angular CLI](https://github.com/angular/angular-cli) version 16.2.0.
- [Angular](https://angular.io)## Thoughts
- I left the activatedRoute code.
- I used transform to make the testId a number instead of a string.
- I think the transform property makes the @Input strategy more useful than activatedRoute.
- Also, you don't have to differentiate between params / queryParams with @Input().
- I renamed permission to have a different name - you pass the name defined in the route to @Input() and then you can change the variable to something else.## Directions
In this small application, you can pass data though routing to `TestComponent`. v16 of Angular introduced `RouterInput`. The goal of this exercice is to refactor the code to use the new `RouterInput` strategy.
## Useful Resources
- [FreeCodeCamp](https://www.freecodecamp.org/news/use-input-for-angular-route-parameters/) - use input for angular route parameters