-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Modal: string argument to the open method is confusing #727
Comments
How about something like ngbModal.open(MyModalComponent).then(value => ... where the component is passed the to avoid having to specify import {ModalComponent} from '@ng-bootstrap/ng-bootstrap'
@Component({})
class MyModalComponent extends ModalComponent {
ngOnInit() {
this.modal.close(value) // or
this.modal.dismiss(value)
}
} where abstract class MyModalComponent {
@Input()
public modal: ModalInstance
} |
Actually it would be very ng1-ish to pass the modal instance as an input. Better would be to have two outputs, |
This here does something similar: http://plnkr.co/edit/ZAZqZu?p=preview |
My vote would go on removing the string argument completely, as it's just utterly confusing. |
For anyone interested in this issue, here is the design doc for introducing components as arguments to the |
See http://stackoverflow.com/q/39464345/1418796
Really, the string argument is only good for unit-testing but not for any real-life applications. We should remove it altogether or at least clarify in the docs.
On top of this we need to support components as arguments to the
open
method, see #680The text was updated successfully, but these errors were encountered: