Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 with 508 accessability

Anyone knows anything about, how to implement accessibility in Angular 2 with Typescript?

Angular 2 has Accessibility (ARIA-enabled) feature, but I didn't find any kind of samples/examples, I searched a lot but didn't find anything. Does anyone know how to implement it?

like image 343
Sagar Ganesh Avatar asked Sep 09 '26 15:09

Sagar Ganesh


1 Answers

You can use all aria attributes by using attribute binding:

<!-- create and set an aria attribute for assistive technology -->
<button [attr.aria-label]="actionName">{{actionName}} with Aria</button>

For example you can use the aria role attribute on a div container as shown below:

<div [attr.role]="ariaRole">

[attr.role] binds the role attribute to the result of expression ariaRole.


You can find all available aria-attributes here.

like image 88
muetzerich Avatar answered Sep 12 '26 04:09

muetzerich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!