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

I understand no one is really maintaining this... #66

Open
MikeDigitalExample opened this issue Dec 1, 2020 · 2 comments
Open

I understand no one is really maintaining this... #66

MikeDigitalExample opened this issue Dec 1, 2020 · 2 comments

Comments

@MikeDigitalExample
Copy link

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:

@Morgul
Copy link
Owner

Morgul commented May 6, 2022

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.)

@eliezerjg
Copy link

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

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

No branches or pull requests

3 participants