
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
angular-modal-simple
Advanced tools
Provides a simple, minimal configuration modal implementation.
npm install angular-modal-simple
Angular 10.1+
Import AngularModalModule into your application:
@NgModule({
...
imports: [
AngularModalModule.forRoot()
]
...
})
Import ModalService to display ModalComponents.
@Injectable()
public class TestService {
constructor(private modalService: ModalService) {}
displayTest(): void {
this.modalService.display(TestComponent);
}
}
ModalOptions configuration options include:
| Property | Type | Description | Default |
|---|---|---|---|
| canClose | boolean | Determines whether the user can close the Modal | true |
| data | any | Data which will populate the Component's @Input() fields | {} |
| dismissibleMask | boolean | Determines whether clicking the Modal container mask will close the Modal | true |
| styles | {} | Allows custom styling to be assigned to the Modal instance | {} |
| zIndex | number | The zIndex for the given Modal instance | 0 |
ModalService.setDefaultOptions() can be used to define the default ModalOptions for all Modal instances.
| Function | Parameters | Description |
|---|---|---|
| display | component: any, options: ModalOptions | Displays the provided Component, using the provided ModalOptions (if present). Any properties that are not present in options will utilize the defaults provided in ModalService |
| close | component: any | Closes the provided Component instance |
| closeAll | - | Closes all open Modal instances |
| isActive | component: any | Determines if the provided Component is currently open in a Modal instance |
| setDefaultOptions | options: ModalOptions | Sets the default ModalOptions that will be used for each new Modal instance |
| setViewContainerRef | viewContainerRef: ViewContainerRef | Sets the ViewContainerRef that new Modal instances will be injected into (by default, ModalService will utilize ApplicationRef and inject all Modal instances into the <body> element) |
TestComponent:
@Component()
public class TestComponent {
@Input() inputA: string;
@Input() inputB: number;
}
TestService:
@Injectable()
public class TestService {
constructor(private modalService: ModalService) {}
displayTest(): void {
this.modalService.display(TestComponent, {
data: {
inputA: 'test',
inputB: 3
},
dismissableMask: false,
styles: {
backgroundColor: '#eee'
}
});
}
}
FAQs
Provides a simple, minimal configuration modal implementation.
The npm package angular-modal-simple receives a total of 14 weekly downloads. As such, angular-modal-simple popularity was classified as not popular.
We found that angular-modal-simple 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.