Angularjs Table Display From Modal Selection And Checkbox
I have the following angularjs html app: Here is the plunker Student Program Manag
Solution 1:
You need to repopulate the selectedCourses:
var ModalInstanceCtrl = function ($scope, $modalInstance, detail) {
$scope.selectedCourses= [];
angular.forEach(detail.subcategory2, function(item) {
$scope.selectedCourses.push(item.course);
});
//the rest of your code
})
And then, to remove it, you just need to clear out the array before you push the items onto it:
$scope.ok = function () {
$scope.subcategory.subcategory2 = [];
for(var i = 0; i < $scope.selectedCourses.length; i++)
$scope.subcategory.subcategory2.push({course: $scope.selectedCourses[i], term:"---",credit:"---",grade:"---"});
$modalInstance.close();
};
Post a Comment for "Angularjs Table Display From Modal Selection And Checkbox"