# @lukana/modals

> Modals using only `@angular/cdk` as dependencies.

Latest version **2.0.2** (published 2023-01-31) · 0 weekly downloads

## Install

```sh
npm install @lukana/modals
pnpm add @lukana/modals
yarn add @lukana/modals
bun add @lukana/modals
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2023-01-31 |
| First published | 2018-06-29 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 93.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | piernik |
| Keywords | modal, modals, cdk, angular, angular-cdk |

## Links

- npm: https://www.npmjs.com/package/@lukana/modals
- npm.io page: https://npm.io/package/@lukana/modals

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.0.0

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads
- [react-native-modal-translucent-axton](https://npm.io/package/react-native-modal-translucent-axton.md) — 4 weekly downloads

## Recent versions

- 2.0.2 (latest) — 2023-01-31
- 2.0.1 — 2022-12-20
- 2.0.0 — 2022-12-08
- 0.9.2 — 2020-06-02
- 0.9.1 — 2020-06-02
- 0.9.0 — 2020-03-23
- 0.1.5 — 2019-04-04
- 0.1.4 — 2019-01-18
- 0.1.3 — 2019-01-18
- 0.1.2 — 2018-10-19
- 0.1.1 — 2018-10-19
- 0.1.0 — 2018-09-07
- 0.0.9 — 2018-08-31
- 0.0.8 — 2018-08-09
- 0.0.7 — 2018-07-04
- … 6 more at https://npm.io/package/@lukana/modals/versions

## README

# Lukana modals

Modals using only `@angular/cdk` as dependencies.

# Usage

1. Add `@lukana/modals/scss/modal` to Your `style.scss` file or use Your own styles.
1. Import `ModalsModule` as dependency.
1. Add modals content component to `entryComponents`
1. Inject `ModalService` as dependency in You component, and open modal with command `ModalService.open(YourComponent)`:

    ```typescript
    @Component({
      selector: 'app-page',
      templateUrl: './app-page.component.html'
    })
    export class AppPageComponent implements OnInit {

      constructor(private modalService: ModalService) {
      }

      ngOnInit() {
      }

      onOpenModal() {
        const dataPassedDoComponent = {name: 'Hello'};
        this.modalService.open(ModalContentComponent, dataPassedDoComponent)
          .subscribe(resp => console.log('returned', resp));
      }
    }
    ```

1. In modal component You can Inject `ModalService` and close modal with return value like this:

    ```typescript

    @Component({
      selector: 'lukana-modal-content',
      templateUrl: './modal-content.component.html',
      styleUrls: ['./modal-content.component.css']
    })
    export class ModalContentComponent implements OnInit {
      name: string;
      constructor(private modalService: ModalService) {
      }

      ngOnInit() {
      }

      onClose() {
        this.modalService.close('returnValue');
      }
    }
    ```

---
_Source: https://npm.io/package/@lukana/modals · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
