我想在ngGrid顯示以下陣列如何使用ngGrid在AngularJS中顯示數組數據?
$scope.pathinfo = ["28.86 GB left on dir1","28.86 GB left on dir2"]
我的控制器看起來是這樣的:
$scope.restorePathGridOptions = { data: '$scope.pathInfo',
columnDefs: [
{field: 'entry', displayName: 'Free Space for paths'}
]
}
這是我的HTML:
<div id="RestorepathsGrid" class="gridStyle" ng-grid="restorePathGridOptions">
我假設'入口'是在索引0和1的數組的數據值。
但是網格根本不顯示。
任何想法爲什麼?