-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
demo(snackbar): Add accessibility demo page for snack bar (#6362)
* demo(snackbar): Add accessibility demo page for snack bar * Remove pizza example
- Loading branch information
1 parent
1f80d2e
commit 9bdd228
Showing
5 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<section> | ||
<h2>Notification</h2> | ||
<p>Showing a notification by snack bar without showing actions</p> | ||
<button md-raised-button color="primary" (click)="openNotificationSnackBar()"> | ||
Support | ||
</button> | ||
</section> | ||
|
||
<section> | ||
<h2>Disco party </h2> | ||
<p>Showing a notification by snack bar with a dismiss button</p> | ||
<button md-button (click)="openDiscoPartySnackBar()">Disco</button> | ||
</section> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {Component} from '@angular/core'; | ||
import {MdSnackBar} from '@angular/material'; | ||
|
||
@Component({ | ||
moduleId: module.id, | ||
selector: 'snack-bar-a11y', | ||
templateUrl: 'snack-bar-a11y.html', | ||
}) | ||
export class SnackBarAccessibilityDemo { | ||
constructor(private snackBar: MdSnackBar) {} | ||
|
||
openDiscoPartySnackBar() { | ||
this.snackBar.open('Disco party!', 'Dismiss', {duration: 5000}); | ||
} | ||
|
||
openNotificationSnackBar() { | ||
this.snackBar.open('Thank you for your support!', '', {duration: 2000}); | ||
} | ||
} |