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

Custom modal content #2251

Closed
davidloiret opened this issue Jul 21, 2017 · 2 comments · Fixed by #2293
Closed

Custom modal content #2251

davidloiret opened this issue Jul 21, 2017 · 2 comments · Fixed by #2293

Comments

@davidloiret
Copy link
Contributor

It would be awesome if we could pass some custom content to the ModalComponent in the following way: modalService.show(ModalComponent, customContent) method.

@Sliverb
Copy link

Sliverb commented Jul 21, 2017

I second

@jvanrossum
Copy link

I have found a workaround as follows:

var modalRef = this.bsModalService.show(ModalComponent);
var modalComponent = modalRef.content as ModalComponent;
modalComponent.title = "Title";
modalComponent.updateView();

In your component inject private cd: ChangeDetectorRef and add the updateView method:

updateView() {
    this.cd.detectChanges();
}

But it would be nicer that the show method BsModalService provided a way to pass data directly.
A discussion at ng-bootstrap about this has already taken place:
ng-bootstrap/ng-bootstrap#861

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