javascript
  • jquery
  • html
  • angularjs
  • fullcalendar
  • 2016-07-26 9 views 0 likes 
    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 
     
        }); 
     
    
     
    })();

    +1

    あなたはカレンダーをui-calendarに渡しているだけで、設定オブジェクト全体を渡すわけではありません。私はこの特定の指令がどのように動作するはずかは分かりませんが、 '$ ctrl.uiConfig'のすべてを渡すべきではありませんか? – Jay

    +0

    が働いていました......実際にはカレンダーを削除し、すべてをuiConfigに入れて、ui-calendar .....に渡しました。 – Robin

    +0

    問題ありません!私はちょうど答えとして投稿するつもりです、ちょうど誰か他の人が同じ問題を抱えている – Jay

    答えて

    1

    0を渡して試してみてくださいのオブジェクトはui-calendarになります。現在、eventClickは、そのディレクティブに渡すオブジェクトの内部にはありません。

    関連する問題