0
から特定のデータのみを取得することは私のコード..です私はホーム/ GetAllAttendanceDataにサービスを提供するためにJSON文字列を渡すと私はcontroller.hereでそれを取得したいコントローラ
public JsonResult GetAllAttendanceData()
{
var ab = (from obj in db.Attendances where obj.Id==1 select new {EmpNTLogin = obj.EmpNTLogin });
return this.Json(ab,JsonRequestBehavior.AllowGet);
}
## Heading ##
angular.module('myModule', []).service("crudAJService", function ($http) {
this.getdata = function() {
return $http.get("Home/GetAllAttendanceData");
};
}).controller('myController', function ($scope, crudAJService) {
$scope.divBook = false;
GetAlldata();
function GetAlldata() {
debugger;
var getAttendanceData = crudAJService.getdata();
getAttendanceData.then(function (Attendances) {
$scope.Attendancesdata = Attendances.data
alert($scope.Attendancesdata);
}, function() {
alert('Error in getting book records');
});
}
});
私は(警告の文字列を表示したいです$ scope.Attendancesdata);
あなたが今得るか何を、正確に問題は何ですか? –
アラート($ scope.Attendancesdata)で、それは[オブジェクト] [オブジェクト]を示します – akash
私は上記のC#コード – akash