Created
June 1, 2021 20:26
-
-
Save twerske/60d7c1001fc70aadcdc592f61839a7b4 to your computer and use it in GitHub Desktop.
Announce changes with LiveAnnouncer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LiveAnnouncer } from '@angular/cdk/a11y'; | |
import { Component } from '@angular/core'; | |
@Component(...) | |
export class ColorPickerDialogComponent { | |
color = '#fff'; | |
public defaultColors: string[] = [...]; | |
constructor(private liveAnnouncer: LiveAnnouncer) { } | |
public changeColor(color: string): void { | |
this.liveAnnouncer.announce(`Select color: ${color}`); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment