Recall & Review
beginner
What is a container component in Angular?
A container component manages data and logic. It fetches data, handles user actions, and passes data to presentational components. It does not focus on how things look.
Click to reveal answer
beginner
What is a presentational component in Angular?
A presentational component focuses on how things look. It receives data via inputs and emits events via outputs. It does not manage data fetching or business logic.
Click to reveal answer
intermediate
Why separate container and presentational components?
Separating them makes code easier to read and maintain. Containers handle logic, presentational components handle UI. This separation helps reuse UI parts and test logic separately.
Click to reveal answer
intermediate
How do container components communicate with presentational components in Angular?
Container components pass data to presentational components using @Input properties. Presentational components send events back using @Output EventEmitters.
Click to reveal answer
beginner
Give an example of a presentational component's role.
A presentational component might display a list of items with buttons. It shows the items it receives and emits an event when a button is clicked, without knowing where data comes from.
Click to reveal answer
What is the main responsibility of a container component?
✗ Incorrect
Container components handle data fetching and business logic, not just UI or styling.
How does a presentational component receive data?
✗ Incorrect
Presentational components get data through @Input properties passed from container components.
Which component should handle user interaction logic?
✗ Incorrect
Container components handle user interaction logic and pass data/events to presentational components.
What does a presentational component emit to notify events?
✗ Incorrect
Presentational components use @Output EventEmitter to send events back to container components.
Why is separating container and presentational components helpful?
✗ Incorrect
Separation improves code clarity, maintainability, and allows reusing UI components easily.
Explain the difference between container and presentational components in Angular.
Think about who handles data and who handles display.
You got /4 concepts.
Describe how container and presentational components work together in an Angular app.
Consider the flow of data and events between components.
You got /5 concepts.