course details changes done

This commit is contained in:
gandhimathi 2017-12-22 13:45:22 +05:30
parent bedf13b2bd
commit 602dfdf939

View File

@ -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 = "";
}
});
};
}]);