gpt4 book ai didi

javascript - 参数如何通过 Ionic Modal 传递?

转载 作者:行者123 更新时间:2023-12-03 06:51:34 25 4
gpt4 key购买 nike

就像我们通过模态传递参数一样,如下面的 resolve 示例所示:

$scope.someFunction = function(item) {
item.root = true;
modalInstance = $uibModal.open({
animation: true,
controller: 'newController',
templateUrl: '/views/modals/somePage.html',
resolve: {
params: function () {
return { item: item};
}
}
});
};

我不知道如何在 ionicModal 中传递参数??

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

是否有一个选项与上面的 ionicModal 代码中的 animation 一起使用?

非常感谢您的帮助!

最佳答案

您不需要传递任何数据。您的父范围已作为

传递
scope : $scope

因此您可以将数据作为scope.item

请关注此网址 https://forum.ionicframework.com/t/how-to-pass-data-from-parent-controller-to-ionicmodal/2030/2

关于javascript - 参数如何通过 Ionic Modal 传递?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37475429/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com