Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create a modal programmatically? #1830

Closed
eestein opened this issue Mar 29, 2017 · 9 comments · Fixed by #2047
Closed

How to create a modal programmatically? #1830

eestein opened this issue Mar 29, 2017 · 9 comments · Fixed by #2047

Comments

@eestein
Copy link

eestein commented Mar 29, 2017

I'm sorry if this has been answered already, I did search but couldn't find it...

I'm trying to migrate from ng-bootstrap, but I just hit a road block...
Using ng-bootstrap I was able to retrieve my modal's instance by:

let modal: NgbModalRef = this.modalService.open(this.config.createModal);
let modalInstance: BaseModal = modal.componentInstance as BaseModal;

Where this.config.createModal is my custom modal component.

I couldn't find in the docs (specially in the demos) something similar for ng2-bootstrap.

Could anyone shed some light here? Is it possible? If so, how can I do this? If not, are there any workarounds?

Thank you.

@valorkin
Copy link
Member

modal service is coming soon

@eestein
Copy link
Author

eestein commented Mar 30, 2017

@valorkin cool, thanks. Not to be a pain here, but do you have any ETA?

@valorkin
Copy link
Member

First thing is to land v2 with new datepicker
Then I can land modal service

@eestein
Copy link
Author

eestein commented Mar 31, 2017

@valorkin thanks :)

@tommueller
Copy link

Any news on the ETA on this?

@IlyaSurmay
Copy link
Contributor

Work is in progress #2047

valorkin pushed a commit that referenced this issue Jul 18, 2017
fixes #1998
fixes #1995
fixes #1830
fixes #1181
fixes #579 

* feat(modal): modal service wip

* feat(modal): wip, add close buttons attribute support, add ability to open modaol with component

* feat(modal): add config, move creating of loader to constructor, add demo

* fix(modal): fix service path

* fix(modal): fix api-docs

* fix(modal): fix scroll on modals created by service, add docs

* feat(modal): wip, add BsModalService.show output obj

* refactor(modal): change inner component getter

* feat(modal): add BsModalRef and docs

* feat(modal): remove data-attributes, return BsModalRef, update docs

* feat(modal): add docs for BsModalService, BsModalRef, update demo

* feat(modal): add bs4 support

* feat(modal): keep focus inside a modal

* chore(modals): small refactoring (#2128)

* chore(modals): simplify service (#2130)

* chore(modal): view container ref made optional for component loader (#2133)

* fix(modal): fix backdrop flickering

* fix(modal): fix backdrop click on the left/right sides, add class option

* feat(modals): nested modals wip

* fix(modal): fix multiple hide() call

* fix(modal): fix multiple backdrop clicks, fix padding

* fix(modal): fixed padding

* fix(modal): fix page flickering

* feat(modal): add isAnimated support, add service section to demo

* fix(test): fix popover and tyepahead unit tests
@eestein
Copy link
Author

eestein commented Jul 18, 2017

@valorkin @IlyaSurmay Awesome! Which version will this be in and when will it be out?

Thanks! :D

@valorkin
Copy link
Member

@eestein one PR to go #2058
than heavy testing and ready for publish
most probably tomorrow v1.8.0

@eestein
Copy link
Author

eestein commented Jul 18, 2017

@valorkin that's great, thank you! :)

@IlyaSurmay great work! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants