Bird
0
0

You have two standalone directives: HighlightDirective and BorderDirective. How do you apply both to a single element in a component template?

hard📝 Application Q9 of 15
Angular - Standalone Components
You have two standalone directives: HighlightDirective and BorderDirective. How do you apply both to a single element in a component template?
A
B
C
D
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular directive attribute syntax

    Multiple attribute directives are applied by listing their selectors as separate attributes.
  2. Step 2: Evaluate options

    correctly applies both directives as separate attributes. Others use invalid syntax.
  3. Final Answer:

    <div appHighlight appBorder></div> -> Option D
  4. Quick Check:

    Multiple directives = multiple attributes [OK]
Quick Trick: Use separate attributes for each directive [OK]
Common Mistakes:
  • Using commas or pipes between directive names
  • Using square brackets incorrectly
  • Trying to combine directives in one attribute

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes