Recall & Review
beginner
What is the main purpose of directives in Angular?
Directives let you add behavior to HTML elements, making your app interactive and dynamic without changing the element's core structure.Click to reveal answer
beginner
How do directives help in reusing code in Angular?
Directives allow you to package common behaviors and apply them to many elements, so you write code once and reuse it everywhere.
Click to reveal answer
intermediate
What types of directives exist in Angular and why are they important?
Angular has three types: components (with templates), attribute directives (change appearance/behavior), and structural directives (change layout). Each type helps manage UI in a clear way.
Click to reveal answer
intermediate
Why can't we just use plain HTML and JavaScript instead of Angular directives?
Directives provide a clean, organized way to add behavior that fits Angular's reactive model, making apps easier to build, maintain, and test compared to mixing plain HTML and JS.
Click to reveal answer
intermediate
How do directives improve the separation of concerns in Angular apps?
Directives separate UI behavior from layout and data logic, so each part of the app has a clear role, making the code easier to understand and update.
Click to reveal answer
What is a key reason Angular uses directives?
✗ Incorrect
Directives let you add custom behavior to HTML elements, making the UI interactive.
Which directive type changes the layout by adding or removing elements?
✗ Incorrect
Structural directives change the layout by adding or removing elements from the DOM.
Why are directives better than plain JavaScript for UI behavior in Angular?
✗ Incorrect
Directives work with Angular's reactive system, making apps easier to maintain and test.
Which of these is NOT a type of Angular directive?
✗ Incorrect
Database directive is not a type of Angular directive.
How do directives help with code reuse?
✗ Incorrect
Directives package behavior so you can reuse it on many elements without rewriting code.
Explain why Angular directives are needed and how they improve building web apps.
Think about how directives make HTML elements smarter and easier to manage.
You got /4 concepts.
Describe the different types of Angular directives and their roles.
Focus on what each directive type controls in the UI.
You got /3 concepts.