Skip to content

Conversation

zealotrahl
Copy link

Checklist for challenge submission

  • Start your PR message with Answer:${challenge_number}

@github-actions github-actions bot added 1 exercice projection answer answer labels Jan 18, 2025
@zealotrahl
Copy link
Author

I can't get fully idea of ngTemplateOutlet, to me it looks too complicated; I believe this is straightforward and simple solution having the constraints mentioned;

@zealotrahl zealotrahl changed the title Answer:1 Answer:1 - straightforward, no usage of ngTemplateOutlet Jan 18, 2025
@tomalaforge tomalaforge added the sponsor sponsor the project label Jan 27, 2025
@tomalaforge
Copy link
Owner

Indeed your solution works, but if I make the exercise more complex like asking to add an icon for the city card only or a edit button or anything else, you will have a hard time and you will need to add a lot of condition inside your component.
Moreover you will need to edit your shared component which can be used by many teams and add a lot of friction.
Your answer will work for this use case but it's not very scalable or maintainable in an application that will always require more features

};
});
});
}
Copy link
Owner

Choose a reason for hiding this comment

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

Don't use imperative coding, try to code in a declaration way, which means try to do the same but without the subscribe.

And use signals. 😉

Copy link
Author

Choose a reason for hiding this comment

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

Hi, thank you, declarative seems like a trend in Angular, especially with signals.
I will try to adapt it. I understand that such a style is safer than mutating the state.

<ng-content select="[card-img]"></ng-content>
<section>
<app-list-item
*ngFor="let item of list"
Copy link
Owner

Choose a reason for hiding this comment

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

no more ngfor, use the new control flow

Copy link
Author

Choose a reason for hiding this comment

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

done

private teacherStore: TeacherStore,
private studentStore: StudentStore,
) {}
@Output() deleteItemEvent = new EventEmitter<number>();
Copy link
Owner

Choose a reason for hiding this comment

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

use the new input and output function.

Copy link
Author

Choose a reason for hiding this comment

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

done

@tomalaforge
Copy link
Owner

Don't hesitate to ask question if something is unclear

Copy link

This pull request is stale because it has been open for 15 days with no activity.

@github-actions github-actions bot added the stale label Feb 17, 2025
@github-actions github-actions bot added the to be reviewed PR requests a review label Oct 12, 2025
@zealotrahl
Copy link
Author

Indeed your solution works, but if I make the exercise more complex like asking to add an icon for the city card

Thank you, I will review ng ngTemplateOutlet, I honestly struggle to understand the use case for it yet

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 stale to be reviewed PR requests a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants