0.0.4 • Published 2 years ago

ng-dynamic-modal-z v0.0.4

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

NgDynamicModalZ

This library was generated with Angular CLI version 13.3.0.

Description

This is most similar to the material dialog it creates the global instance, No need Id same as the bootstrap javascript modal open. every open modal time clears previous all instances.

Installing

RUN npm i ng-dynamic-modal-z

Instruction

  1. After installing this modal first add modal module in your required module

    import {NgDynamicModalZModule} from 'ng-dynamic-modal-z'; @NgModule({ imports: [NgDynamicModalZModule] }) export class AppModule{};

  2. Where you want to open use this code for that component.

    inject modalService to your component and use open function for open modal

    ` import {NgDynamicModalZService} from 'ng-dynamic-modal-z'; import {ChildComponent} from './child-component';

    @Component({ //... }) export class ParentComponent { constructor(private modalService: NgDynamicModalZService) {}

    openModal() {
        const data = {a: 1, b: 2};
        this.modalService.open(ChildComponent, {
            width: "750px",
            title: "modal title",
            height:"400px",
            disableBackdropClose:false
        })
        .subscribe(response => { })
        .unsubscribe();;
    }

    }; `

  3. in you modal component

    modal clossing ;

    ` import {NgDynamicModalZService} from 'ng-dynamic-modal-z';

    @Component({ //... }) export class ParentComponent { constructor(private modalService: NgDynamicModalZService) {}

    close(){
        modalService.close();
    }

    };

    `

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago