Bird
0
0

How should you correctly reference an external CSS file in an Angular component decorator?

easy📝 Syntax Q3 of 15
Angular - Components
How should you correctly reference an external CSS file in an Angular component decorator?
AstyleUrls: ['./component-style.css']
Bstyles: ['./component-style.css']
CstyleUrl: './component-style.css'
DstyleSheets: ['./component-style.css']
Step-by-Step Solution
Solution:
  1. Step 1: Understand Angular syntax

    Angular uses styleUrls as an array of strings to link external CSS files.
  2. Step 2: Check the options

    Only styleUrls: ['./component-style.css'] correctly uses styleUrls with an array containing the CSS file path.
  3. Final Answer:

    styleUrls: ['./component-style.css'] -> Option A
  4. Quick Check:

    Correct property name and array format [OK]
Quick Trick: Use styleUrls as an array for external CSS files [OK]
Common Mistakes:
  • Using styles instead of styleUrls for external files
  • Not using an array for styleUrls
  • Misspelling styleUrls property

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes