Skip to content

Conversation

lukasss88
Copy link

Checklist for challenge submission

@github-actions github-actions bot added 1 exercice projection answer answer labels Oct 21, 2025
@tomalaforge tomalaforge added sponsor sponsor the project to be reviewed PR requests a review labels Oct 22, 2025
CardType = CardType;
export class CardComponent<T> {
readonly list = input<T[] | null>(null);
readonly itemTemplate = input<TemplateRef<any> | null>(null);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can do it this way or you can use contentChild to get the template from the parent

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can other type your template with a directive instead of using any

cardType = CardType.STUDENT;

ngOnInit(): void {
this.http.fetchStudents$.subscribe((s) => this.store.addAll(s));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can now use new angular API like rxRessource to fetch data and being declarative

[name]="item.firstName"
[id]="item.id"
[type]="cardType"
(onDeleteItem)="deleteTeacher($event)"></app-list-item>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very good
You don't need to pass id, when you get the onDeleteItem, you can pass item.id to the function in the parent

@tomalaforge tomalaforge removed the to be reviewed PR requests a review label Oct 23, 2025
@tomalaforge
Copy link
Owner

very good PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 exercice projection answer answer sponsor sponsor the project

2 participants