-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
base: main
Are you sure you want to change the base?
Conversation
Test branch change
e06cdd4
to
459e831
Compare
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; |
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. |
}; | ||
}); | ||
}); | ||
} |
There was a problem hiding this comment.
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. 😉
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Don't hesitate to ask question if something is unclear |
This pull request is stale because it has been open for 15 days with no activity. |
86688b2
to
029b2eb
Compare
Thank you, I will review ng ngTemplateOutlet, I honestly struggle to understand the use case for it yet |
Checklist for challenge submission