如何从json中提醒数据 [英] How to alert a data from json
本文介绍了如何从json中提醒数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用角度工厂检索了json数据。当我提醒数据时,它显示undefined。我的json是:
I have retrieved json data using angular factory.When I alert the data it displays undefined.My json is:
[{"chqNoId":5,"chqNo":5,"custName":"Bikash Paneru","status":"cancelled"}]
我只想在发出警报时提醒状态:
I want to alert status only when I alert using :
alert($scope.Cheque); It displays [object Object]
alert($scope.Cheque.status); It displays undefined
。
如何提醒状态?
我尝试过:
.
How to alert status?
What I have tried:
$scope.ChqStatus = function(chqno)
{
crudServiceUser.GetChqStatus(chqno).then(function (result) {
$scope.Cheque = result;
alert($scope.Cheque);
alert($scope.Cheque.status));
})
}
推荐答案
scope.Cheque);它显示[object Object]
alert(
scope.Cheque); It displays [object Object] alert(
scope.Cheque.status);它显示未定义的
scope.Cheque.status); It displays undefined
。
如何提醒状态?
我尝试过:
.
How to alert status?
What I have tried:
scope.ChqStatus = function(chqno) )
{
crudServiceUser.GetChqStatus(chqno).then(function(result){
scope.ChqStatus = function(chqno) { crudServiceUser.GetChqStatus(chqno).then(function (result) {
这篇关于如何从json中提醒数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文