Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
frag.jetzt SWTP 2022
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Marc Tröll
frag.jetzt SWTP 2022
Commits
14e42b37
Commit
14e42b37
authored
5 years ago
by
Paul Fugmann
Browse files
Options
Downloads
Patches
Plain Diff
Update Making html elements a11y.md - How to add the LiveAnnouncer to a page
parent
758aae93
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/a11y/Making html elements a11y.md
+30
-0
30 additions, 0 deletions
docs/a11y/Making html elements a11y.md
with
30 additions
and
0 deletions
docs/a11y/Making html elements a11y.md
+
30
−
0
View file @
14e42b37
...
...
@@ -45,3 +45,33 @@ For usage only the `attr.` tag prefix must be added like in following code examp
@see https://blog.prototypr.io/accessible-components-2-dynamic-aria-labels-6bf281f26d17
### Live Announcer
##### To Add Live Announcer you need to import:
``import { LiveAnnouncer } from '@angular/cdk/a11y';``
##### And add to the constructor:
```
constructor(
...
private liveAnnouncer: LiveAnnouncer) {
...
}
```
##### You also need to add to the ngOnInit() - Function:
```
ngOnInit() {
...
this.announce();
}
```
##### And this is the function to start the announcement:
```
public announce() {
this.liveAnnouncer.announce('Willkommenstext', 'assertive');
}
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment