0.2.5 • Published 3 years ago

@brewermap/dialog v0.2.5

Weekly downloads
7
License
-
Repository
-
Last release
3 years ago

Brewer Map Dialog

Dynamic dialog component for Angular

npm i @brewermap/dialog

Setup

Be sure your app.module (or the module you wish to use the package) includes the DialogModule

import { DialogModule } from '@brewermap/dialog';

@NgModule({
  imports: [
    CommonModule,
    DialogModule
  ]
})

Usage

Simply import the DialogService and the DialogOverlayRef in the calling component (AppComponent for example):

import { DialogOverlayRef } from '@brewermap/dialog/lib/dialog.reference';
import { DialogService } from '@brewermap/dialog';

Then create an instance in the controller:

constructor( private myDialog: DialogService) {}

And finally inside a trigger function generate the reference to the dialog:

public openThemeDialog(): void {
    const myDialogRef: DialogOverlayRef = this.myDialog.open(
        string | TemplateRef<any> | Type<any>, // Could be a simple text, a component or a template reference
        'Title',
        null, // Data send
        'left' | 'right' | 'bottom' | 'center', // Position of the dialog
        boolean | string // Choose to show close button or the label for it
    );
}
0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.0

3 years ago

0.2.2

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

4 years ago

0.1.6

4 years ago