ng-modal-factory
TypeScript icon, indicating that this package has built-in type declarations

17.0.0 • Public • Published

WARNING!

🚨 🚨 🚨

This package is still under development and is not optimized nor tested. Please have some time and check back later ;)

🚨 🚨 🚨

NG Modal Factory

The purpose of this packages is to allow the display a (modal-)component, within everywhere inside of the application. The (modal-)component will be rendert inside of the outlet.

Installation

$ npm i ng-modal-factory

Quick Start

1. Import the Module

@NgModule({
  ...
  imports: [
    ...,
    ModalFactoryModule
  ]
  ...
})
export class AppModule { }

2. Place the outlet

...
<ng-modal-factory-outlet></ng-modal-factory-outlet>
...

3. Open a Modal (This example was using the Clarity Design Framework)

public openModal()
  {
    this.modalFactoryService.openNewAlertModal({
      component: AlertModalComponent, <-- Your modal component
      inputs: {
        bodyTemplate: this.modalBody, <-- Your modal body
        buttons: [
          {
            text: 'custom',
            style: 'link',
            click: () => console.log('custom')
          },
          {
            text: 'Cancel',
            style: 'outline',
            click: () => console.log('Cancel'),
          },
          {
            text: 'Ok',
            type: 'primary',
            click: () => console.log('Ok'),
          },
        ],
      },
    });
  }

Readme

Keywords

Package Sidebar

Install

npm i ng-modal-factory

Weekly Downloads

3

Version

17.0.0

License

MIT

Unpacked Size

31.1 kB

Total Files

14

Last publish

Collaborators

  • pheim