diff --git a/src/dev-app/live-announcer/BUILD.bazel b/src/dev-app/live-announcer/BUILD.bazel
index b7b1420f0082..50ddd7322ad3 100644
--- a/src/dev-app/live-announcer/BUILD.bazel
+++ b/src/dev-app/live-announcer/BUILD.bazel
@@ -9,5 +9,6 @@ ng_module(
deps = [
"//src/cdk/a11y",
"//src/material/button",
+ "//src/material/dialog",
],
)
diff --git a/src/dev-app/live-announcer/live-announcer-demo.html b/src/dev-app/live-announcer/live-announcer-demo.html
index 7e7fb39b0aed..ce4533f59420 100644
--- a/src/dev-app/live-announcer/live-announcer-demo.html
+++ b/src/dev-app/live-announcer/live-announcer-demo.html
@@ -1,6 +1,28 @@
-
+
+
+
+
+
+
+ Live Announcer Test Dialog
+ Test LiveAnnouncer inside an aria modal.
+
+
+
+
+
diff --git a/src/dev-app/live-announcer/live-announcer-demo.ts b/src/dev-app/live-announcer/live-announcer-demo.ts
index 6e46f456159b..548b7e93a7e4 100644
--- a/src/dev-app/live-announcer/live-announcer-demo.ts
+++ b/src/dev-app/live-announcer/live-announcer-demo.ts
@@ -6,9 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/
-import {Component} from '@angular/core';
+import {Component, TemplateRef, ViewChild} from '@angular/core';
import {A11yModule, LiveAnnouncer} from '@angular/cdk/a11y';
import {MatButtonModule} from '@angular/material/button';
+import {MatDialog} from '@angular/material/dialog';
@Component({
selector: 'toolbar-demo',
@@ -17,9 +18,17 @@ import {MatButtonModule} from '@angular/material/button';
imports: [A11yModule, MatButtonModule],
})
export class LiveAnnouncerDemo {
- constructor(private _liveAnnouncer: LiveAnnouncer) {}
+ constructor(
+ private _liveAnnouncer: LiveAnnouncer,
+ public dialog: MatDialog,
+ ) {}
announceText(message: string) {
this._liveAnnouncer.announce(message);
}
+
+ @ViewChild(TemplateRef) template: TemplateRef;
+ openDialog() {
+ this.dialog.open(this.template);
+ }
}