Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Passing in animation to $modalService #1101

Closed
mjhamm75 opened this issue Sep 24, 2014 · 5 comments
Closed

Passing in animation to $modalService #1101

mjhamm75 opened this issue Sep 24, 2014 · 5 comments

Comments

@mjhamm75
Copy link

When I create a modal in my markup, the animation works like expected. Here is an example:
<a href="" bs-modal="settings.deleteAccountModal" data-animation="am-fade-and-slide-top" data-template="js/donor/settings/confirm-modal.html" class="trashOut"></a>
But when I try to create the same modal with the $modalService, the animation does not work. Here is my js code:

this.openModal = function() {
        $modal({
            animation: 'am-fade-and-slide-top',
            backdropAnimation: 'am-fade',
            scope: $scope,
            title: "Are you sure?",
            backdrop: 'static',
            template: 'js/donor/settings/confirm-modal.html',
            show: true
        });
    };

How do I configure the animations with the $modalService?

@vmlf01
Copy link
Collaborator

vmlf01 commented Oct 23, 2014

Hi, seems to work when I changed the docs sample to use the $modal service. Can you please provide a plunker with your problem?

@Onlydreams
Copy link

Meeting the same question and here is my plunker:
http://plnkr.co/edit/DW4xTU9nTegyV1s9Tq6O
The animation doesn't work.

@vmlf01
Copy link
Collaborator

vmlf01 commented Apr 24, 2015

You need to include both ngAnimate and custom CSS for the animations to work. AngularStrap uses AngularMotion CSS animations, but you can create your own.
Here is an updated plunker with the animations working: http://plnkr.co/edit/uK4QxyWnlvBWzsZ7MnPW?p=preview

I changed the script to load Angular 1.3 because there seems to be some compatibility issues with 1.4 as mentioned in another issue here.

@stale
Copy link

stale bot commented Jan 26, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 26, 2019
@stale stale bot closed this as completed Feb 4, 2019
@lock
Copy link

lock bot commented May 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the outdated label May 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants