Q1. What is the difference between Angular components, directives, and pipes?
Components are the core building block — they combine an HTML template, CSS styles, and TypeScript class with a @Component decorator. They represent a portion of the UI. Directives modify the behaviour or appearance of existing DOM elements — structural directives (NgIf, NgFor) change the DOM structure, attribute directives (NgClass, NgStyle) change appearance. Pipes transform displayed values in templates: {{ date | date:"dd/MM/yyyy" }}. Custom pipes implement PipeTransform. Components have a view; directives and pipes do not. Everything in Angular is ultimately a directive — components are directives with templates.