Kendoui与Angular - 看不到网格

时间:2013-12-24 16:42:55

标签: javascript angularjs angularjs-directive kendo-grid

我正在尝试使用带有角度的kendo ui,我已经下载了kendo.all.js和angular-kendo.js 我创建了一个简单的控制器

var testApp = angular.module('testApp', ['ngRoute', 'kendo.directives']);
testApp.controller('mainCtrl', function mainCtrl($scope) {
$scope.name='Hello';

$scope.products = new kendo.data.DataSource({
    data: [
        { id: 1, name: 'Tennis Balls', department: 'Sports', lastShipment: '10/01/2013' },
        { id: 2, name: 'Basket Balls', department: 'Sports', lastShipment: '10/02/2013' },
        { id: 3, name: 'Oil', department: 'Auto', lastShipment: '10/01/2013' },
        { id: 4, name: 'Filters', department: 'Auto', lastShipment: '10/01/2013' },
        { id: 5, name: 'Dresser', department: 'Home Furnishings', lastShipment: '10/01/2013' }
    ]
});

});

并添加到视图

<div>
    <div kendo-grid k-data-source="products" k-selectable="'row'"
            k-pageable="{ 'refresh': true, 'pageSizes': true }"
            k-columns="[
{ 'field': 'name, 'title': 'Name''},
{ 'field': 'department', 'title': ''Department'},
{ 'field': 'lastShipment', 'title': 'Last Shipment' }
   ]"> 
    </div>
</div>

然而,当我启动它时,我得到空白页面没有错误

1 个答案:

答案 0 :(得分:0)

我忘了添加angular.module('testApp',['ngRoute','kendo.directives']);