Component patterns and reusable forms
Learn Component patterns and reusable forms (Module 26 · Architecture and Design Patterns, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Smart and presentational components • A smart (container) component knows about services, loads data and handles events. A presentational (UI) component only receives data with input() and reports user actions with output() . Analogy: the smart component is the chef (decides and cooks), the presentational component is the plate (shows what it is given). • The container and UI component pattern is the same idea under different names. It makes UI parts reusable, easy to test (no HTTP) and fast with OnPush.