Angularjs ionic framwork中的Angular ui FullCalendar事件打开模式单击功能
我正在使用Ionic框架,我已经成功地将FullCalendar移植到我的项目中 我可以在eventClick上调用函数,即使它完美地给出了该事件标题的警报 但我的主要目标是打开离子模式,而不是使用事件标题打开alert() 代码一直工作到警报到来,我是新来的爱奥尼亚需要一些想法如何实现这一点。到目前为止,我已经编写了下面的代码 app.js代码:Angularjs ionic framwork中的Angular ui FullCalendar事件打开模式单击功能,angularjs,events,modal-dialog,ionic-framework,fullcalendar,Angularjs,Events,Modal Dialog,Ionic Framework,Fullcalendar,我正在使用Ionic框架,我已经成功地将FullCalendar移植到我的项目中 我可以在eventClick上调用函数,即使它完美地给出了该事件标题的警报 但我的主要目标是打开离子模式,而不是使用事件标题打开alert() 代码一直工作到警报到来,我是新来的爱奥尼亚需要一些想法如何实现这一点。到目前为止,我已经编写了下面的代码 app.js代码: $scope.calOptions = { editable : true, header
$scope.calOptions = {
editable : true,
header : {
left: 'prev',
center: 'title,today',
right: 'next'
},
eventClick: function(calEvent, jsEvent, view){
var a=calEvent.description;
var b=calEvent.title;
alert('ALERT-1:' +a );
$scope.safeApply(function()
{
alert('ALERT-2:' + calEvent.description);
$scope.eventModal(a,b)
});
};
$scope.eventModal=function(a,b){
alert('ALERT-3:'+b);
$scope.eventModal.show();
}
$ionicModal.fromTemplateUrl('modal.html', function($ionicModal) {
$scope.eventModal = $ionicModal;
},{
scope: $scope,
// The animation we want to use for the modal entrance
animation: 'slide-in-up'
});
更清楚地说,上面的代码显示“eventClick
:”一直工作到“ALERT-3”,但是,在事件单击时,它调用函数“$scope.eventModal=function(a,b)
”,然后在$scope.eventModal.show()的下一行调用该函数代码>它说“show不是一个函数
”,我想用传递给“$scope.eventModal=function(a,b)
”函数的变量打开modal
需要一个方法来打开传递给“$scope.eventModal=function(a,b)
”的参数的模式
提前完成任务。尝试做一些更简单的事情:
eventClick: function(calEvent, jsEvent, view){
$scope.a = calEvent.description;
$scope.b = calEvent.title;
$ionicModal.fromTemplateUrl('modal.html', {
scope: $scope
}).then(function (modal) {
$scope.modal = modal;
$scope.modal.show();
}).catch(function(err){
console.log(err);
});
};
在modal中,您可以绑定{{::a}和{{::b}或者您想用它们做的任何事情