Open Closed

How to use "NgbModal.open" in ABP Modal #7755


User avatar
0
tony.chen@sjrb.ca created

ABP ModalComponent is using ng-boostrap under the hood which is good. However, I don't see anywhere mentioned "NgbModal.open" function in ABP Modal documentation. (https://abp.io/docs/latest/framework/ui/angular/modal)

Is there a different way to approach this in ABP? The goal is we want to have a new instance inside of modal window when display every time.

Reference from ng-boostrap: https://ng-bootstrap.github.io/#/components/modal/api#NgbModal open open(content: any, options: NgbModalOptions) => NgbModalRef Opens a new modal window with the specified content and supplied options. Content can be provided as a TemplateRef or a component type. If you pass a component type as content, then instances of those components can be injected with an instance of the NgbActiveModal class. You can then use NgbActiveModal methods to close / dismiss modals from "inside" of your component. Also see the NgbModalOptions for the list of supported options.


5 Answer(s)
  • User Avatar
    0
    sumeyye.kurtulus created
    Support Team Angular Expert

    Hello, as you may derive from the codebase (https://github.com/abpframework/abp/tree/dev/npm/ng-packs/packages/theme-shared/src/lib/components/modal), ABP modal component supports all the options in the same way with the NgbModalOptions

    Since then the open function in the library will handle the options by appending them to the modal refence, you can implement the intended behavior.

    If you think that your case is not dependent on this, I can assist you further.

  • User Avatar
    0
    tony.chen@sjrb.ca created

    Thanks for the advice. Is that possible ABP can include this type of feature by default?

    I believe this can benefit all users. Also, angular material UI uses the same practice. (https://material.angular.io/components/dialog/api)

  • User Avatar
    0
    sumeyye.kurtulus created
    Support Team Angular Expert

    If your aim is to utilize the Material Dialog component, as far as I have understood, we do not have such a plan in the short term. However, we can discuss this for our long term plans.

  • User Avatar
    0
    tony.chen@sjrb.ca created

    Hello Sumeyye, we don't have plan on using Angular Material components. We want to use out-of-box components from ABP framework, and this component injection for Modal windows is important for building the front-end application. I would like your team to consider on adding this feature into your roadmap. Thanks.

  • User Avatar
    0
    masum.ulu created
    Support Team Angular Expert

    Hi tony

    We provide an component as abp-modal you can use and utilize this component. We didn't create an service to manage modal process or we didn't use this service from Bootstrap. Yet you can still use BS modal service in your project we don't have any plan wrap or use it for now.

    Thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09