course controller added
This commit is contained in:
parent
e6ad9db665
commit
67711ce479
@ -92,7 +92,7 @@ app.controller('universityCtrl', ["$scope", "toaster", "$filter", "ngTableParams
|
||||
$scope.editId = -1;
|
||||
}
|
||||
|
||||
$scope.updateUniversityDetails = function (form, p) {
|
||||
$scope.updateUniversityDetails = function (form, p,loading) {
|
||||
var firstError = null;
|
||||
if (form.$invalid) {
|
||||
var field = null, firstError = null;
|
||||
@ -108,7 +108,10 @@ app.controller('universityCtrl', ["$scope", "toaster", "$filter", "ngTableParams
|
||||
}
|
||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||
} else {
|
||||
} else {
|
||||
$rootScope.ldloading2 = {};
|
||||
|
||||
$rootScope.ldloading2[loading.replace('-', '_')] = true;
|
||||
p.IsActive = p.IsActive === true ? 1 : 0;
|
||||
var req = {
|
||||
method: 'POST',
|
||||
@ -125,10 +128,13 @@ app.controller('universityCtrl', ["$scope", "toaster", "$filter", "ngTableParams
|
||||
if (response.data.updateUniversityStatus = true) {
|
||||
swal("Success!", response.data.message, "success");
|
||||
$scope.getUniversityList();
|
||||
$rootScope.ldloading2[loading.replace('-', '_')] = false;
|
||||
$scope.editId = -1;
|
||||
|
||||
} else {
|
||||
// $scope.ldloading1[loading.replace('-', '_')] = false;
|
||||
swal("Failed!", response.data.message, "error");
|
||||
$rootScope.ldloading2[loading.replace('-', '_')] = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -136,7 +142,7 @@ app.controller('universityCtrl', ["$scope", "toaster", "$filter", "ngTableParams
|
||||
|
||||
// add university
|
||||
$scope.universityForm = {
|
||||
submit: function (form, myModel) {
|
||||
submit: function (form, myModel,loading) {
|
||||
var firstError = null;
|
||||
if (form.$invalid) {
|
||||
var field = null, firstError = null;
|
||||
@ -153,6 +159,9 @@ app.controller('universityCtrl', ["$scope", "toaster", "$filter", "ngTableParams
|
||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||
} else {
|
||||
$rootScope.ldloading1 = {};
|
||||
|
||||
$rootScope.ldloading1[loading.replace('-', '_')] = true;
|
||||
$scope.myModel.switchsetting = $scope.myModel.switchsetting === true ? 1 : 0;
|
||||
var req = {
|
||||
method: 'POST',
|
||||
@ -168,10 +177,12 @@ app.controller('universityCtrl', ["$scope", "toaster", "$filter", "ngTableParams
|
||||
$http(req).then(function (response) {
|
||||
if (response.data.addUniv == true) {
|
||||
swal("Success!", response.data.message, "success");
|
||||
$rootScope.ldloading1[loading.replace('-', '_')] = false;
|
||||
$state.go($state.current, {}, { reload: true });
|
||||
} else {
|
||||
// $scope.ldloading1[loading.replace('-', '_')] = false;
|
||||
swal("Failed!", response.data.message, "error");
|
||||
$rootScope.ldloading1[loading.replace('-', '_')] = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user