我已經設置了一個角度應用程序,它使用了pivot.js tp構建一個數據透視表。我得到一個錯誤如何在角度應用程序中使用Pivot.js?
"Cannot read property 'derivers' of undefined"
這裏是代碼:
HTML:
app.js
routerApp.controller('productPivot',['$scope','$http','$objectstore',function($scope,$http,$objectstore){
$scope.products = [];
var client = $objectstore.getClient("com.duosoftware.test","product");
client.onGetMany(function(data){
if (data){
$scope.products = data;
var derivers = $.pivotUtilities.derivers;
$("#productsPivotTableOutput").pivotUI($scope.products, {
rows: ["Name"],
cols: ["CanBeSold"],
rendererName: "Table"
});
}
});
client.getByFiltering("*");
}]);
我必須在某處注入樞軸js嗎?這是我遵循的示例! Pivot with angular
你加載了你的pivot.js嗎? – 2015-03-02 06:27:41