I am using Angular 4 with ng-bootstrap as shown here
I am trying to get the modal to slide and fade in/out, but there are no examples provided to do that. I have tried both solutions on this thread, such as opening my modal like so with a custom class 'slideInUp' -
this.modalService.open(content, {centered: true, backdrop: 'static', keyboard: false, windowClass:'slideInUp'}).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
}, (reason) => {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
})
And adding the css for the 'slideInUp' -
.slideInUp {
-webkit-animation-name: slideInUp;
animation-name: slideInUp;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes slideInUp {
0% {
-webkit-transform: translateY(100%);
transform: translateY(100%);
visibility: visible;
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
@keyframes slideInUp {
0% {
-webkit-transform: translateY(100%);
transform: translateY(100%);
visibility: visible;
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
The class gets applied, but the transition does not happen. Strangely, if I apply the slideInUp class to any other element, such as the body element of the modal, it works and body content slides up when the modal is opened.
Any help would be appreciated.