diff --git a/Apollo/assets/js/controllers/studentViewCtrl.js b/Apollo/assets/js/controllers/studentViewCtrl.js new file mode 100644 index 00000000..ef9b3964 --- /dev/null +++ b/Apollo/assets/js/controllers/studentViewCtrl.js @@ -0,0 +1,43 @@ +'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 = ""; + + } + }); + + }; + +}]); +