course details changes done

This commit is contained in:
gandhimathi 2018-02-14 10:52:27 +05:30
parent 2b90e903bd
commit 076b2d4dfe

View File

@ -24,11 +24,24 @@ app.controller("activityCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$
$scope.editId = -1;
$scope.setEditId = function (p) {
$scope.localStatusDetails="";
$scope.localStatusDetails = JSON.parse(localStorage.getItem('localStatusDetails'));
$scope.editId = p.ActivityID;
$scope.editStatusList = [];
angular.forEach(p.statusDetails, function (values, keys) {
$scope.editStatusList.push(values.ListCode);
$scope.editData = {
name: values.ListName,
id: values.ListCode
};
var subresult = $filter('filter')($scope.localStatusDetails, $scope.editData);
if(subresult.length==0){
$scope.localStatusDetails.push($scope.editData);
}
})
$scope.viewEditStatus = {
list: $scope.editStatusList,
@ -127,6 +140,7 @@ swal("Warning!", "Status are required", "warning");
$scope.loader = '';
$scope.emptyData = '';
$scope.init = function () {
localStorage.setItem('localStatusDetails', '');
var getActivity = {
method: 'POST',
@ -165,6 +179,8 @@ swal("Warning!", "Status are required", "warning");
$scope.statusList.push($scope.statusData);
})
}
localStorage.setItem('localStatusDetails', JSON.stringify($scope.statusList));
});
};