angularjs 加载程序在FullCalendar插件中不工作

8yparm6h  于 2022-10-31  发布在  Angular
关注(0)|答案(1)|浏览(140)

我正在使用FullCalendar(http://fullcalendar.io/)插件与AngularJs我需要显示加载器时,数据加载到日历。我正在使用加载触发器来显示加载器

$scope.uiConfig = {loading: $scope.loading}
$scope.loading = function( isLoading, view ) {
          if(isLoading) {// isLoading gives boolean value
              $('#loading').show();
          } else {
              $('#loading').hide();
          }
        }

解释其工作原理

vybvopom

vybvopom1#

fullcalendar的loading回调在事件获取开始/停止时触发。
function( isLoading, view ){} //isLoading is true when events fetching //is started else false when done

JS代码:

$('#calendar').fullCalendar({
  header: {
    left: 'prev,next today',
    center: 'title',
    right: 'month,agendaWeek,agendaDay'
  },
  year: 2010,
  month: 0, // January
  editable: true,
  events: '/gh/gist/response.json/6218404/',
  loading: function( isLoading, view ) {
      if(isLoading) {// isLoading gives boolean value
          $('#wait').show();
      } else {
          $('#wait').hide();
      }
  }
});

Working demo @ JSFiddle
参考文献:

相关问题