Skip to content
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

Answer:1 solution projection pre v16 #167

Closed
wants to merge 1 commit into from
Closed

Conversation

tomalaforge
Copy link
Owner

Checklist for challenge submission

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

@tomalaforge tomalaforge added 1 exercice projection answer author answer of author labels Oct 4, 2023
@tomalaforge tomalaforge closed this Oct 4, 2023
},
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CardComponent<T> {

Choose a reason for hiding this comment

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

May I ask how you tell T it has an id prop? using the @for loop now needs a track param, so this gives me an error:
image

Choose a reason for hiding this comment

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

Normally I would tell T it expects an id prop like this, but then it breaks in the city card component:

export class CardComponent<T extends {id: string}> {

image

Choose a reason for hiding this comment

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

Nevermind found my issue, id is a number, so the types were not overlapping...

{{ name }}
<button (click)="delete(id)">
<ng-content></ng-content>
<button (click)="delete.next()">

Choose a reason for hiding this comment

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

Hey, I have a question, why did you use delete.next() instead of delete.emit(), Ive researched this and nextCall() seems to be deprecated

https://github.com/angular/angular/blob/b5b6ece65a96f5b8f134ad4899b56bf84afe3ba0/modules/angular2/src/facade/async.dart#L49

@tomalaforge tomalaforge removed 1 exercice projection answer author answer of author labels Apr 14, 2024
@tomalaforge tomalaforge changed the title feat(Answer:1): solution projection Answer:1 solution projection pre v16 Apr 15, 2024
@tomalaforge tomalaforge added 1 exercice projection answer author answer of author labels Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 exercice projection answer author answer of author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants