Open MikeDigitalExample opened 3 years ago
Interesting. Nothing really should have changed in this project to break it like that. And I can tell you that when I was last using this project, that functionality worked, because I was using my own controllers for modals.
I tracked down some of my old code, and this was working:
`import VerificationModalController from './verification';`
// ... bunch of unrelated code ...
_launchModal()
{
return this.$modal.open({
template: require('./verification.html'),
size: 'lg',
keyboard: false,
backdrop: 'static',
windowClass: 'modal-full',
controller: VerificationModalController,
controllerAs: '$ctrl'
})
.result
.finally(function()
{
stateSvc.changeMode('normal');
});
}
// ... more unrelated code ...
If directly importing your controller (or, as a test, just writing a dummy one as a function inline) doesn't work, then there's definitely a bug and it needs to be tracked down. (If you can find the change in this repo that broke it and put in a PR, I'll be glad to merge it and make a release.)
im stuck in a project that uses this lib, anyone knows if there is any bs5 alternative for ui-boostrap and bootstrap dialog for angular js ? thx
The issues forum is NOT for support requests. It is for bugs and feature requests only. Please read https://github.com/angular-ui/bootstrap/blob/master/CONTRIBUTING.md and search existing issues (both open and closed) prior to opening any new issue and ensure you follow the instructions therein.
Bug description:
I uiboostrap for bs 3 if you created a modal and didn't pass it a new controller, it would use the controller for the page you were on. I believe you could also pass in the controller and controllerAs for the current controller, into your modal, and it would use the current object.
This version always creates a new controller object. There is no way to pass in anything remotely useful for the johnpapa standard of using vm=this;
I have tested in all way shapes and forms, and short of passing in a service to hold the data to be edited, there is no real way to connect the current page data.
I found this to be true because modalInstance was null whenever the break point was hit to close the modal. Because using the current pages controller, instantiated a new copy of the controller.
Is there a way to get your current page viewmodel/controller into the modal?
Thanks
Link to minimally-working plunker that reproduces the issue:
Steps to reproduce the issue:
Version of Angular, UIBS, and Bootstrap
Angular:
UIBS:
Bootstrap: