Bird
0
0

Examine this Angular component decorator:

medium📝 Debug Q6 of 15
Angular - Components
Examine this Angular component decorator:
@Component({
  selector: 'app-demo',
  styleUrls: ['demo.component.css']
})
export class DemoComponent {}

What is the issue with the styleUrls property?
AThe path should be relative and enclosed in quotes inside an array, which is correct here
BstyleUrls should be a string, not an array
CThe file extension .css is not supported in styleUrls
DstyleUrls property is misspelled and should be styleUrl
Step-by-Step Solution
Solution:
  1. Step 1: Review Angular styleUrls syntax

    The styleUrls property expects an array of strings with relative paths to CSS files.
  2. Step 2: Check the provided code

    The code uses styleUrls: ['demo.component.css'], which is the correct format.
  3. Final Answer:

    No error; the styleUrls property is correctly declared -> Option A
  4. Quick Check:

    styleUrls must be an array of strings [OK]
Quick Trick: styleUrls requires an array of string paths [OK]
Common Mistakes:
  • Using a string instead of an array for styleUrls
  • Misspelling styleUrls as styleUrl
  • Omitting quotes around file paths

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes