0.0.1 • Published 2 years ago

angular-dynamic-dialog-lib-for-everyone v0.0.1

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

MyDialog

This library was generated with Angular CLI version 14.2.0.

Code scaffolding

Run ng generate component component-name --project my-dialog to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project my-dialog.

Note: Don't forget to add --project my-dialog or else it will be added to the default project in your angular.json file.

Build

Run ng build my-dialog to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build my-dialog, go to the dist folder cd dist/my-dialog and run npm publish.

Running unit tests

Run ng test my-dialog to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.

////////////////////////////////////////////////////////////////////////////////////////////

to use my-dialog, need to pass as atribute component ViewContainerRef

example

constructor(private ref: ViewContainerRef, private myDialog: MyDialogService) {}

openDialog() {

this.myDialog.openDialog(

this.ref, PopupComponent,

{showHeader: true, showFooter: true, clickOutesideClose: false},

{name: 'John Blacksmith'}

)

.pipe(take(1))

.subscribe(res => {

console.log(res)

})

}

Important, dot't forget to unsubscribe from dialog close event in your component. !!!