如何将原生过渡包含在离子模态中?

Cha*_*arG 11 angularjs ionic-framework cordova-plugins

我建立了一个离子应用程序,最初转换速度很慢.所以,我选择了离子原生过渡插件.现在,应用程序转换变得更加平滑,我正在尝试将这些转换应用于我的离子模态.下面是我用来设置离子模态的函数.

function LoadFilter(){
$ionicModal.fromTemplateUrl('templates/filter.html', {
  scope: $scope
}).then(function(modal) {
  $scope.modal = modal;
  $scope.modal.show();
});

$scope.closeFilter = function() {
  $scope.modal.hide();
};

$scope.showFilter = function() {
  $scope.modal.show();
};
Run Code Online (Sandbox Code Playgroud)

知道如何将转换应用于模态吗?

Adi*_*ngh 1

您不需要专门使用ionic-native-transition模态动画。只需将动画属性值传递给传递给的对象,$ionicModal.fromTemplateUrl如下所示:

function LoadFilter(){
  $ionicModal.fromTemplateUrl('templates/filter.html', {
    scope: $scope,
    animation: 'slide-in-up'
   }).then(function(modal) {
     $scope.modal = modal;
     $scope.modal.show();
   });

   $scope.closeFilter = function() {
     $scope.modal.hide();
   };

   $scope.showFilter = function() {
     $scope.modal.show();
   };
}
Run Code Online (Sandbox Code Playgroud)