0
0
Angularframework~20 mins

ARIA attributes in templates in Angular - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
ARIA Accessibility Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding ARIA roles in Angular templates
Which ARIA role should you add to a
Arole="banner"
Brole="contentinfo"
Crole="main"
Drole="navigation"
Attempts:
2 left
💡 Hint
Think about the semantic purpose of the
📝 Syntax
intermediate
2:00remaining
Binding ARIA attributes dynamically in Angular
In Angular, how do you correctly bind the aria-label attribute to a component property named 'labelText' in the template?
Angular
<button _____>Click me</button>
A(aria-label)="labelText"
B[attr.aria-label]="labelText"
Caria-label="[labelText]"
Daria-label="{{labelText}}"
Attempts:
2 left
💡 Hint
Angular uses square brackets for property binding.
rendering
advanced
2:00remaining
Effect of ARIA attributes on screen reader output
Given this Angular template snippet, what will a screen reader announce when focusing on the button?

<button [attr.aria-pressed]="isPressed">Toggle</button>

Assuming isPressed is true.
AButton, Toggle, pressed
BButton, Toggle, not pressed
CButton, Toggle
DButton, Toggle, checked
Attempts:
2 left
💡 Hint
aria-pressed indicates toggle state and is read as 'pressed' or 'not pressed'.
selector
advanced
2:00remaining
Selecting elements with ARIA attributes in Angular templates
Which CSS selector correctly targets all elements with an aria-label attribute in an Angular component's styles?
A#aria-label
B.aria-label
C[aria-label]
Daria-label
Attempts:
2 left
💡 Hint
Attribute selectors use square brackets in CSS.
accessibility
expert
3:00remaining
Ensuring keyboard accessibility with ARIA in Angular
You have a custom dropdown component in Angular that uses a div with role="listbox" and div children with role="option". Which ARIA attribute is essential to update dynamically to indicate the currently focused option for keyboard users?
Aaria-selected
Baria-checked
Caria-expanded
Daria-hidden
Attempts:
2 left
💡 Hint
This attribute tells assistive technologies which option is chosen or focused.