2016-10-04 167 views
0

我在我的項目中使用kendo ui調度程序,但在客戶端下載kendo js和css需要太多時間,因此我們的網站會出現一些緩慢的情況。爲了解決這個問題,我們試圖按照請求的方式下載kendo js和css,只在加載調度程序日曆的那個頁面上。在集成相同的情況下,我們無法添加依賴項「kendo.directive」。請建議如何添加該依賴關係或另一種方法來減少很多延遲。Kendo js在客戶端下載時花費太多時間

請找到相同的代碼。

myApp.requires.push('kendo.directives'); 

myApp.controller('CalenderController',['$scope', '$http', 'StatsService', function ($scope, $http, StatsService) { 
    var self=this; 

    $scope.schedulerOptions = { 
     date: new Date(), 
     startTime: new Date(), 
     showWorkHours: true, 
     height: 600, 
     views: [ 
      "day", 
      {type: "week", selected: true}, 

     ], 
     editable: { 
      destroy: false, 
      create: false, 
      template: $("#editor").html() 
     }, 
     timezone: "GMT", 
     dataSource: { 
      batch: true, 
      transport: { 
       read: function (options) { 
        url = '/consultants/applications/interviews'; 
        $http.get(url).success(function (data, status, headers, config) { 
         options.success(data.result); 
        }).error(function (data, status, headers, config) { 
         options.error(data); 
        }); 
       }, 
       parameterMap: function (options, operation) { 
        if (operation !== "read" && options.models) { 
         return {models: kendo.stringify(options.models)}; 
        } 
       } 
      }, 
      schema: { 
       model: { 
        id: "interviewId", 
        fields: { 
         taskId: {from: "id", type: "number", editable: false}, 
         candidateName: {from: "candidateName" , editable: false}, 
         title: {from: "title", defaultValue: "No title" , editable: false}, 
         companyName: {from: "companyName" , editable: false}, 
         start: {type: "date", from: "interviewTiming", editable: false}, 
         end: {type: "date", from: "interviewEndTiming" , editable: false}, 
         candidateEmail: {from: "candidateEmail" , editable: false}, 
         candidateMobile: {from: "candidateMobile" , editable: false} 
        } 
       } 
      } 
     } 
    }; 
}]); 

回答

相關問題