mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-11 05:13:02 -05:00
feat(challenge1): modernization
This commit is contained in:
@@ -41,12 +41,11 @@ While the application works, the developer experience is far from being optimal.
|
||||
## Constraints
|
||||
|
||||
- You <b>must</b> refactor the `CardComponent` and `ListItemComponent`.
|
||||
- The `NgFor` directive must be declared and remain inside the `CardComponent`. You might be tempted to move it to the `ParentCardComponent` like `TeacherCardComponent`.
|
||||
- `CardComponent` should not contain any `NgIf` or `NgSwitch`.
|
||||
- The `@for` must be declared and remain inside the `CardComponent`. You might be tempted to move it to the `ParentCardComponent` like `TeacherCardComponent`.
|
||||
- `CardComponent` should not contain any conditions.
|
||||
- CSS: try to avoid using `::ng-deep`. Find a better way to handle CSS styling.
|
||||
|
||||
## Bonus Challenges
|
||||
|
||||
- Try to work with the new built-in control flow syntax for loops and conditionals (documentation [here](https://angular.dev/guide/templates/control-flow))
|
||||
- Use the signal API to manage your components state (documentation [here](https://angular.dev/guide/signals))
|
||||
- To reference the template, use a directive instead of magic strings ([What is wrong with magic strings?](https://softwareengineering.stackexchange.com/a/365344))
|
||||
|
||||
@@ -37,12 +37,11 @@ Bien que l'application fonctionne, l'expérience développeur est loin d'être o
|
||||
## Contraintes
|
||||
|
||||
- Vous <b>devez</b> refactoriser le `CardComponent` et le `ListItemComponent`.
|
||||
- La directive `NgFor` doit être déclarée et rester à l'intérieur du `CardComponent`. Vous pourriez être tenté de la déplacer dans le `ParentCardComponent` comme `TeacherCardComponent`.
|
||||
- Le composant `CardComponent` ne doit contenir aucun `NgIf` ni `NgSwitch`.
|
||||
- La boucle `@for` doit être déclarée et rester à l'intérieur du `CardComponent`. Vous pourriez être tenté de la déplacer dans le `ParentCardComponent` comme `TeacherCardComponent`.
|
||||
- Le composant `CardComponent` ne doit contenir aucune condition.
|
||||
- CSS: essayez d'éviter d'utiliser `::ng-deep`. Trouvez un meilleur moyen de gérer le style CSS.
|
||||
|
||||
## Challenges Bonus
|
||||
|
||||
- Essayez de travailler avec la nouvelle syntaxe de contrôle de flux pour les boucles et les conditions (documentation [ici](https://angular.dev/guide/templates/control-flow))
|
||||
- Utilisez l'API des signals pour gérer l'état de vos composants (documentation [ici](https://angular.dev/guide/signals))
|
||||
- Pour référencer le template, utilisez une directive au lieu d'une magic string ([Qu'est-ce qui pose problème avec les magic string ?](https://softwareengineering.stackexchange.com/a/365344))
|
||||
|
||||
Reference in New Issue
Block a user