angular-strap icon indicating copy to clipboard operation
angular-strap copied to clipboard

Passing in animation to $modalService

Open mjhamm75 opened this issue 12 years ago • 5 comments

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?

mjhamm75 avatar Sep 24 '14 21:09 mjhamm75

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

vmlf01 avatar Oct 23 '14 14:10 vmlf01

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

Onlydreams avatar Apr 24 '15 03:04 Onlydreams

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.

vmlf01 avatar Apr 24 '15 07:04 vmlf01

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[bot] avatar Jan 26 '19 09:01 stale[bot]

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[bot] avatar May 05 '19 17:05 lock[bot]