
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
angular-a11y-dialog
Advanced tools
This is a Angular wrapper component for a11y-dialog@7.3.0
Angular
Note that A11yDialog is a peer dependency of AngularA11yDialog.
npm install angular-a11y-dialog a11y-dialog
In your app.module.ts application module, in addition to whatever
you already have there, setup the AngularA11yDialogModule:
import { AngularA11yDialogModule } from 'angular-a11y-dialog';
@NgModule({
...
imports: [AngularA11yDialogModule]
})
export class AppModule { }
If you plan to utilize the A11yDialog instance, you'll need to import it:
import { Component } from '@angular/core';
import A11yDialog from 'a11y-dialog';
@Component({
selector: 'app-root',
template: `
<h1>Dialog Test</h1>
<p>The following opens because we've assigned a dialog <code>ref</code>:</p>
<button
type="button"
data-test-id="dialogRefBtn"
(click)="openDialog()"
>
Open dialog via dialogRef
</button>
<p>The following opens because a11y-dialog uses the <code>data-a11y-dialog-show</code> data attribute:</p>
<button
type="button"
data-test-id="dataA11yBtn"
data-a11y-dialog-show="a11y-dialog"
>
Open the dialog via data attribute
</button>
<angular-a11y-dialog
id="a11y-dialog"
dialogRoot="#dialog-root"
closeButtonPosition="last"
(instance)="assignDialogInstance($event)"
>
<div closeButtonContentFirst>
<span>Close (only appears if closeButtonPosition="first" but that's the default)</span>
</div>
<ng-template #titleTemplate>
<span data-test-id="dialogTitle">A11yDialog Test</span>
</ng-template>
<div>
<p>This is some content</p>
</div>
<div closeButtonContentLast>
<span>Close (only appears if closeButtonPosition="last")</span>
</div>
</angular-a11y-dialog>
`,
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'angular-a11y-tester';
dialogInstance!: A11yDialog;
openDialog() {
this.dialogInstance.show();
}
assignDialogInstance(instance: A11yDialog) {
this.dialogInstance = instance;
};
}
_Note above we have two approaches to open the dialog:
data-a11y-dialog-show="a11y-dialog" which A11yDialog will listen for.A11yDialog intance reference.In your index.html, add a container where your dialog will be rendered into. In this case, notice the dialog-root element.
<!DOCTYPE html>
<html>
<body>
<div id="app"></div>
<div id="dialog-root"></div>
</body>
</html>
The
a11y-dialogdocumentation is here
ididStringtrueid attribute added to the dialog element, internally used by a11y-dialog to manipulate the dialog.<angular-a11y-dialog id="main-dialog">
<!-- ... -->
</angular-a11y-dialog>
dialogRootdialogRootString — CSS Selector string.true<angular-a11y-dialog dialogRoot="#dialog-root">
<!-- ... -->
</angular-a11y-dialog>
classNamesclassNamesObjectfalse{}base, overlay, document, title, closeButton.<angular-a11y-dialog classNames="{ base: 'base-class', overlay: 'overlay-class' }">
<!-- ... -->
</angular-a11y-dialog>
titleIdtitleIdStringfalseid + '-title'.id attribute of the dialog’s title element, used by assistive technologies to provide context and meaning to the dialog window.<angular-a11y-dialog titleId="main-title">
<!-- ... -->
</angular-a11y-dialog>
closeButtonLabelcloseButtonLabelStringfalse'Close this dialog window'aria-label attribute of the close button, used by assistive technologies to provide extra meaning to the usual cross-mark.<angular-a11y-dialog closeButtonLabel="Close this super dialog">
<!-- ... -->
</angular-a11y-dialog>
roleroleStringfalsedialogrole attribute of the dialog element, either dialog (default) or alertdialog to make it a modal (preventing closing on click outside of ESC key).<angular-a11y-dialog role="alertdialog">
<!-- ... -->
</angular-a11y-dialog>
instancea11y-dialog instance or undefined.a11y-dialog instance once the component has been initialised. When it gets destroyed, the event returns undefined. This is needed to call instance methods of the dialog, e.g. this.dialog.show().<angular-a11y-dialog (instance)="assignDialogInstance($event)">
<!-- ... -->
</angular-a11y-dialog>
You can obtain the instance reference and use:
export class AppComponent {
dialogInstance!: A11yDialog;
openDialog() {
this.dialogInstance.show();
}
assignDialogInstance(instance: A11yDialog) {
this.dialogInstance = instance;
};
}
titletitle<angular-a11y-dialog>
<ng-template #titleTemplate>
<span>Your title</span>
</ng-template>
<!-- ... -->
</angular-a11y-dialog>
closeButtonContentFirstcloseButtonContentFirstcloseButtonPosition is first so you will use this slot for the close button content. However, if you supply last or none for closeButtonPosition this slot will be ignored.<angular-a11y-dialog>
<div closeButtonContentFirst>
<span>Close (only appears if closeButtonPosition="first" but that's the default)</span>
</div>
<!-- ... -->
</angular-a11y-dialog>
closeButtonContentLastcloseButtonContentLastcloseButtonPosition is first, so unless you supply last for closeButtonPosition this slot will be ignored.<angular-a11y-dialog closeButtonPosition="last">
<div closeButtonContentLast>
<span>Close (only appears if closeButtonPosition="last")</span>
</div>
<!-- ... -->
</angular-a11y-dialog>
closeButtonPositioncloseButtonPositionfirstfirst, last, or none<angular-a11y-dialog closeButtonPosition="last">
<div closeButtonContentLast>
<span>Close (only appears if closeButtonPosition="last")</span>
</div>
<!-- ... -->
</angular-a11y-dialog>
FAQs
Angular component wrapping for a11y-dialog
We found that angular-a11y-dialog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.