New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

angular-modal-simple

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-modal-simple

Provides a simple, minimal configuration modal implementation.

latest
Source
npmnpm
Version
0.2.2
Version published
Weekly downloads
99
1880%
Maintainers
1
Weekly downloads
 
Created
Source

Angular Modal

Provides a simple, minimal configuration modal implementation.

Installation

npm install angular-modal-simple

Version Support

Angular 10.1+

Use

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);
    }
}

Configuration Options

ModalOptions configuration options include:

PropertyTypeDescriptionDefault
canClosebooleanDetermines whether the user can close the Modaltrue
dataanyData which will populate the Component's @Input() fields{}
dismissibleMaskbooleanDetermines whether clicking the Modal container mask will close the Modaltrue
styles{}Allows custom styling to be assigned to the Modal instance{}
zIndexnumberThe zIndex for the given Modal instance0

ModalService.setDefaultOptions() can be used to define the default ModalOptions for all Modal instances.

ModalService:

FunctionParametersDescription
displaycomponent: any, options: ModalOptionsDisplays the provided Component, using the provided ModalOptions (if present). Any properties that are not present in options will utilize the defaults provided in ModalService
closecomponent: anyCloses the provided Component instance
closeAll-Closes all open Modal instances
isActivecomponent: anyDetermines if the provided Component is currently open in a Modal instance
setDefaultOptionsoptions: ModalOptionsSets the default ModalOptions that will be used for each new Modal instance
setViewContainerRefviewContainerRef: ViewContainerRefSets 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)

Example:

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'
            }
        });
    }
}

Keywords

simple

FAQs

Package last updated on 26 Apr 2021

Did you know?

Socket

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.

Install

Related posts