angular.module('MyApp') //extending angular module from first part .controller('BudgetAndDetails', function ($scope, BDetail) { //explained about controller in Part2 $scope.budgetdetails = []; BDetail.GetBDetails().then(function (d) { $scope.budgetdetails = d.data; }); $scope.removeRow = function (item) { var index = $scope.budgetdetails.indexOf(item); if (index < 0) { $scope.budgetdetails.push(item) } else { $scope.budgetdetails.splice(index, 1) } }; })
[HttpPost] public JsonResult update(BudgetandDetails budget) { var obj = _db.budgets.FirstOrDefault(b => budget.budget.idBudget == b.idBudget); _db.budgets.Remove(obj); _db.SaveChanges(); return Json(obj, JsonRequestBehavior.AllowGet); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)