Ngx-bootstrap: Modal Module Default Configurations

Created on 5 Mar 2019  路  2Comments  路  Source: valor-software/ngx-bootstrap

Is there any option for default configurations. For example, igronebackdropclick always false, but i want to set it just one time to true. Otherway i must configurate all the modal show actions one by one.

comp(modal) question

Most helpful comment

I import the ModalModule in the SharedModule, and export it too.
In the constructor I configured the modal. Not as beautiful as using Injection token, but it works.

export class SharedModule {
  constructor(private modalService: BsModalService) {
    this.modalService.config.class = 'modal-lg';
    this.modalService.config.ignoreBackdropClick = true;
  }
}

All 2 comments

I import the ModalModule in the SharedModule, and export it too.
In the constructor I configured the modal. Not as beautiful as using Injection token, but it works.

export class SharedModule {
  constructor(private modalService: BsModalService) {
    this.modalService.config.class = 'modal-lg';
    this.modalService.config.ignoreBackdropClick = true;
  }
}

your code is great,I done that inside AppComponent:

export class AppComponent {
  constructor(private modalService: BsModalService) {

    this.modalService.config.ignoreBackdropClick = true;
....
  }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

juanitavollmering picture juanitavollmering  路  3Comments

PascalHonegger picture PascalHonegger  路  3Comments

MihaiHoriaPopescu picture MihaiHoriaPopescu  路  3Comments

tpiros picture tpiros  路  3Comments

webdev48 picture webdev48  路  3Comments