简体   繁体   English

让屏幕阅读器在Angular app中读取新的页面标题

[英]Make screen reader read new page title in Angular app

I have an angular app in which I am setting the titles of each page using the $stateChangeSuccess event handler. 我有一个角度应用程序,我在其中使用$stateChangeSuccess事件处理程序设置每个页面的标题。 The titles are changing fine when I change the page. 当我更改页面时,标题正在改变。

Problem: From an accessibility standpoint, when a user changes the page in my app, the new title should be read out loud so he/she knows what page he is on. 问题:从可访问性的角度来看,当用户在我的应用程序中更改页面时,应该大声读出新标题,以便他/她知道他所在的页面。 However, as this is a single page app, the title is not re-read by the screen reader. 但是,由于这是一个单页应用程序,屏幕阅读器不会重新读取标题。

I have read other questions on Stack Overflow regarding screen readers but they don't answer my question. 我已经阅读了有关屏幕阅读器的Stack Overflow的其他问题,但他们没有回答我的问题。

Please help. 请帮忙。 Thanks. 谢谢。

为此,您可以使用aria-label指令,如看到这里 ,然后修改元素的可见性时,它需要出现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM