我已经设置了一个角度应用程序,它使用了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