Skip to content

Answer:1 - straightforward, no usage of ngTemplateOutlet #1175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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. 😉

<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

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.

@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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants