Skip to content

Conversation

@ahmed-aouinti
Copy link

Checklist for challenge submission

  • Start your PR message with Answer:${challenge_number}
width="200px" />
<ng-content select="[image]"></ng-content>
<section>
@for (item of list; track item) {
Copy link
Owner

Choose a reason for hiding this comment

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

track: item is a dangerous default track option. You should use it only if the list is not updated (like adding or deleting element) , prefer using a specific property like id

export class CardComponent<T> {
@Input() list: T[] | null = null;
@Output() addedItem = new EventEmitter<void>();
@ContentChild(CardListItemDirective, { read: TemplateRef })
Copy link
Owner

Choose a reason for hiding this comment

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

👍

}),
),
{ initialValue: [] as City[] },
);
Copy link
Owner

Choose a reason for hiding this comment

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

I don't really like this kind of implementation.

Loading the cities just be separate from the state cities.

You should call fetchCities inside the constructor or ngoninit and get the city from the store. More maintainable, easier to read.

@tomalaforge tomalaforge added answer answer 1 exercice projection labels Jan 24, 2024
@tomalaforge
Copy link
Owner

Great work

@tomalaforge tomalaforge closed this Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 exercice projection answer answer

2 participants