0
我想在AngularJS的數據表上實現內聯編輯。我試圖找到一些例子,但我不能。有一個很好的例子here,但它與AngularJS不兼容。那麼,我如何在AngularJS中實現它?如何在AngularJS的數據表上實現內聯編輯?
從我的項目相關代碼:
<tbody>
<tr ng-repeat="meal in meals">
<td>{{ meal.id }}</td>
<td>{{ meal.name }}</td>
<td>
<a ng-click="open_yemek('lg', meal.name, meal.recipe, meal.ingredients)">Tıklayın</a>
</td>
<td class="text-center">
<!--<small class="label label-warning" style="font-size: 9px !important;"><i class="fa fa-clock-o"></i> {{ yemek.sure }}</small>-->
{{ meal.time }}
</td>
<td>{{ meal.category }}</td>
<td>{{ meal.region }}</td>
<td>{{ meal.user }}</td>
<td class="text-center">{{ meal.rank }}/10</td>
<td>{{ meal.status }}</td>
<td>
<i ng-click="editItem($index)" class="fa fa-pencil-square-o" aria-hidden="true"></i>
<a ng-click="removeItem('yemekler',$index)"><i class="fa fa-trash-o" aria-hidden="true"></i></a>
<a ng-click="addItem('yemekler')"><i aria-hidden="true" class="fa fa-plus"></i></a>
</td>
</tr>
</tbody>
這是JS:
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withOption('lengthMenu', [5, 10, 15])
.withOption('autoWidth', true);
$scope.meals = {};
mealFactory.get()
.success(function(data) {
console.log(data);
$scope.meals = data;
});
我試圖改變我的代碼與您的建議,但我不能所以我添加了我的代碼形式。 –
請分享您的JavaScript代碼 – Luxor001
添加JS代碼。顯示的數據正在從數據庫中檢索。 –