任何人都知道,如何使用Typescript在Angular 2中实现可访问性?
Angular 2具有可访问性(启用了ARIA)功能,但是我没有找到任何示例/示例,我进行了很多搜索,但没有找到任何东西。有人知道如何实现吗?
您可以通过使用属性绑定来使用所有aria属性:
<!-- create and set an aria attribute for assistive technology -->
<button [attr.aria-label]="actionName">{{actionName}} with Aria</button>
例如,您可以在div容器上使用aria角色属性,如下所示:
<div [attr.role]="ariaRole">
[attr.role]
将角色属性绑定到表达式ariaRole的结果。
您可以在此处找到所有可用的aria属性。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句