Recall & Review
beginner
What are inline styles in Angular components?
Inline styles are CSS rules written directly inside the component's decorator using the
styles array. They apply styles only to that component.Click to reveal answer
beginner
How do external styles work in Angular components?
External styles are CSS files linked to a component using the
styleUrls property in the component decorator. They keep styles separate from code and can be reused.Click to reveal answer
intermediate
Name one advantage of using inline styles in Angular.
Inline styles keep the styles close to the component code, making it easier to see and change styles quickly for small or unique style rules.
Click to reveal answer
intermediate
What is a benefit of using external styles over inline styles in Angular?
External styles help keep the component code clean and allow sharing styles across multiple components, improving maintainability.
Click to reveal answer
advanced
Can Angular components use both inline and external styles together?
Yes, Angular components can use both
styles and styleUrls together. Inline styles override external styles if there is a conflict.Click to reveal answer
Where are inline styles defined in an Angular component?
✗ Incorrect
Inline styles are defined inside the
styles array directly in the component decorator.What is the main purpose of using external styles in Angular?
✗ Incorrect
External styles keep CSS separate from code and allow reuse across multiple components.
If a style is defined both inline and externally, which one takes precedence?
✗ Incorrect
Inline styles override external styles if there is a conflict.
Which Angular decorator property is used to link external CSS files?
✗ Incorrect
The
styleUrls property links external CSS files to the component.Why might you choose inline styles for a component?
✗ Incorrect
Inline styles are good for quick, small style changes close to the component code.
Explain the difference between inline and external styles in Angular components.
Think about where the CSS code lives and how it affects the component.
You got /4 concepts.
Describe a scenario where you would prefer inline styles over external styles in Angular.
Consider ease of access and simplicity for small style rules.
You got /3 concepts.