0
UIは正常に動作し、イベントは正しく表示されますが、唯一の問題はeventClick
が機能していないことです。私はこの問題を解決するためにjQueryを更新する必要があると思ったが、間違っていた。 eventClick
の動作を妨げる何かがあります。助けてくださいevent-click in angular-ui-カレンダーが機能していません
は、これは私のindex.html
<div class="container">
<div ui-calendar='$ctrl.uiConfig.calendar' ng-model="$ctrl.eventSources">
</div>
</div>
これは私のcontroller.jsある
(function(){
class CalendarComponent {
constructor() {
this.eventSources = [];
this.uiConfig = {
calendar : {
editable : true,
header : {
left : 'prev,next,today',
center : 'title',
right : 'month,agendaWeek,agendaDay'
}
},
eventClick: function(event,jsEvent,view){
console.log("holla");
}
};
this.eventSources = [
{
events: [
{title: "finger painting", start: "2016-07-28T18:00+05:30", location: "SAC middle earth", allDay:false},
{title: "hand painting", start: "2016-07-27T21:30+05:30",location: "CLT", allDay:false}
],
color: "red"
},
{
events: [
{title: "lightmusic", start: "2016-07-29T18:00+05:30", location: "OAT", allDay:false},
{title: "Rock music", start: "2016-07-28T21:30+05:30",location: "SAC middle earth", allDay:false}
],
color: "blue"
}
];
}
}
angular.module('sangamApp')
.component('calendar', {
templateUrl: 'app/calendar/calendar.html',
controller: CalendarComponent
});
})();
あなたはカレンダーをui-calendarに渡しているだけで、設定オブジェクト全体を渡すわけではありません。私はこの特定の指令がどのように動作するはずかは分かりませんが、 '$ ctrl.uiConfig'のすべてを渡すべきではありませんか? – Jay
が働いていました......実際にはカレンダーを削除し、すべてをuiConfigに入れて、ui-calendar .....に渡しました。 – Robin
問題ありません!私はちょうど答えとして投稿するつもりです、ちょうど誰か他の人が同じ問題を抱えている – Jay