Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 从对象解析名称并显示_Javascript_Json_Angularjs_Scope - Fatal编程技术网

Javascript 从对象解析名称并显示

Javascript 从对象解析名称并显示,javascript,json,angularjs,scope,Javascript,Json,Angularjs,Scope,我的对象(未分析和原始): 我正在解析$scope.result对象的属性message $scope.result=JSON.parse($scope.result.message)输出$scope.result.message为 $scope.result.message={"name":"Riana","status":"Postponed","meeting":"Approval No 342","postponedDate":"2015-06-24 18:30:00","postpon

我的对象(未分析和原始):

我正在解析
$scope.result
对象的属性
message

$scope.result=JSON.parse($scope.result.message)输出
$scope.result.message

$scope.result.message={"name":"Riana","status":"Postponed","meeting":"Approval No 342","postponedDate":"2015-06-24 18:30:00","postponedTime":"13:02:57"}
但是如果我想绑定名称
Riana
,我不能在HTMl中绑定 我试图给出{{result.message.name},但无法呈现名称。
有没有办法在HTML中进行解析,因为我无法在控制器中进行解析?

在这句话之后

$scope.result=JSON.parse($scope.result.message);
您的$scope.result对象如下所示

Object {name: "Riana", status: "Postponed", meeting: "Approval No 342", postponedDate: "2015-06-24 18:30:00", postponedTime: "13:02:57"}
在HTML中,您应该这样使用

{{result.name}


不像这个{{result.message.name}

您需要
JSON.parse($scope.result.message)
分配给
$scope.result.message

例如

$scope.result.message = JSON.parse($scope.result.message);
这是


希望有帮助。

你能给我们看一下你的html代码吗?它是这样的{{result.message.name}你从{{result}和{result.message}中得到了什么{result}:{subject:“会议延期状态”,“消息”:“{”name:“RianaMinny\”,“Status\”:“延期”,“会议\:“批准矿区342号”,“延期日期”:2015-06-24 18:30:00“,”推迟时间“:”13:02:57“,”修改日期“:”2015-06-29 17:09:59“,”类别“:”1}和“{result.message}:{”姓名“:”Riana“,”状态“:”推迟“,”会议“:”批准号342“,”推迟日期“:”2015-06-24 18:30:00”,“推迟时间“:”13:02:57”@Riaj Khan名称在消息对象中是否要使用名称进行双向数据绑定?
$scope.result.message = JSON.parse($scope.result.message);