Mumbai Wadala Mumbai Wadala - 22 days ago 5
AngularJS Question

retrieve sql record from webservice and view on textbox

i am creating a web app in which i want to see my record on different textboxes

[{"attendee1":"o","attendee2":"p","totalmale":"2","totalfemale":"2","unit1":"o","unitd1":"o","unit2":"o","unitd2":"o","unit3":"o","unitd3":"o","unit4":"o","unitd4":"o","unit5":"o","unitd5":"o","remarks":"o"}]


this is how my records are coming from
webservice
when i supply a parameter(
(string id)
) how i need to retrieve the record and show the record on my textbox with the help of
AngularJS


this is my
js
file

$http.get('/frmattendencerptqed.asmx/getuprec', {
params: {
id: $scope.updateparam.comsonvinid
}
})


now what i need to do when i want to print the records in different textboxes

my textboxes are in input field
<input type="text" ng-model="attendee1" />


this is how all my textboxes are

i need your help what i need to do when i want to show the record on my textboxes

Answer

According to the data you provided i made small example for you.in this you need to assign your result to a scope variable like below

$scope.something=your result;

from this fetch your value and assign to your model,here i am taking attendee1 and assigning to model

$scope.attendee1=$scope.something[0].attendee1;

like this you need to give what ever you want from that result. Demo