44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
'use strict';
|
|
/**
|
|
* controllers for ng-table
|
|
* Simple table with sorting and filtering on AngularJS
|
|
*/
|
|
|
|
app.controller('studentViewCtrl', ["$scope","$rootScope", "toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", function ($scope,$rootScope, toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state) {
|
|
/*
|
|
* used to get student course details
|
|
* this method called from view ng-init directive
|
|
* created by kms
|
|
* */
|
|
|
|
$scope.getStudentDetails = function () {
|
|
var getcourse = {
|
|
method: 'POST',
|
|
url: apiPoint.url + 'getStudentBasicInfo/',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
data: {
|
|
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
|
|
|
}
|
|
};
|
|
$http(getcourse).then(function (response) {
|
|
|
|
if (response.data.status == 200 && response.data.studentStatus== true) {
|
|
$scope.studentDetails = response.data.studentDetails;
|
|
$scope.courseDetails = response.data.courseDetails;
|
|
|
|
|
|
} else {
|
|
$scope.studentDetails = "";
|
|
$scope.courseDetails = "";
|
|
|
|
}
|
|
});
|
|
|
|
};
|
|
|
|
}]);
|
|
|