Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Modal is not showing (only backdrop is showing)

Yael Shrem premium asked 5 years ago


Expected behavior modal.show() opens modal

Actual behavior modal.show() set only backdrop and no modal added

Resources (screenshots, code snippets etc.) I am showing the modal in the ngOnInit function, when the modal is view child variable

like this:

export class ShowAndHideModalComponent { @ViewChild('demoBasic') demoBasic: ModalDirective;

showAndHideModal() { this.demoBasic.show(); } }


Bartosz Termena staff answered 5 years ago


Hi!

Use ngAfterViewInit() instead on ngOnInit()

Hope it helps!

Best Regards, Bartosz.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: 7.2.0
  • Device: B
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No