How to display selected data from json object
When I run this function I have a JSON object as shown in the picture I just want to display only the selected option, say username.
[displaying json object on running this function][1]
$scope.signUp = function () {
$http({
method: "post",
dataType:'json',
url: "http://192.168.0.60/api/Customer/CustomerLoginService",
crossDomain : true,
data: {
'username': $scope.username,
'password': $scope.password,
'entrytoken': $scope.entrytoken
},
headers: { 'Accept':' text/plain','Content-Type': 'application/json' }
}).then(function success(data) {
alert("success function");
var obj=JSON.stringify(data);
alert(obj);
});
how can i display the singe parameter.
+3
source to share
3 answers
headers: { 'Accept':' text/plain','Content-Type': 'application/json' }
}).then(function success(data) {
alert("success function");
// var obj=JSON.stringify(data);
console.log('DATA=',data);
This will allow you to check if the username exists in the data response as a response. Open the browser panel to view the data. please use google chrome
0
source to share