如何从json中检索angularjs表达式的数据
How to retrieve data for angularjs expression from json?
我有一个json响应,我想将数据填充到字段中——我如何使用angularjs表达式来实现这项任务。我如何将值从json响应映射到html页面。
到目前为止,我试过这个。。。
HTML
<div class="row">
<div class="col-md-6">
<label class="control-label">Rule Id</label>
<div>{{ruleIdentifier}}</div>
</div>
<div class="col-md-6">
<label class="control-label">SubpartID</label>
<div>{{subpartId}}</div>
</div>
</div>
MODALCTRL.JS
lrrDetails.findlrrDetail().then(function(response){
$scope.lrrDetail = response;
$scope.ruleidentifier = $scope.lrrDetail.id
})
FACTORY.JS
findlrrDetail: function(result){
return $http.get('/third-party-management/rest/lrr/17181');
$scope.lrrDetail = result.data;
},
JSON.JS
{"id":1,
"sourceFeedKey":15,
"lookupCode":"RS_DELETED",
"externalIndintifier":"47",
"subpartCitationIndicator":"1",
"ruleIdentifier":"13",
"ruleSubpartExternalIdentifier":"55029",
"subpartCount":null,
"subpartCitationCount":null,
"citationValue":"18 U.S.C. 2711",
"ruleName":"Definitions For Chapter",
"highValueSummary":"This chapter provides guidance on stored wire and electronic communications and transactional records access and contains provisions of the Stored Communications
Act.","
issuingAuthKey":873,
"citationAsOfDate":1325566800000,
"vedourActivityType":"Internal Activity",
"vedourActivityDescription1":null,
"vedourActivityDescription2":null,
"applicabilityIndicator":"0",
"auditGroupCategory":null,
"auditGroupIndicator":null,
"citationCoreIndicator":null,
"createdDate":1352497145890,
"modifiedDate":1375313477250,
"createdBy":"ERDSYSTEM",
"mofifiedBy":"NBKQNXS",
"regulatoryInventoryName"
以下是如何使用$http
以及如何填充数据的示例。希望它对你有用。http://jsfiddle.net/8qumcq80/1/
相关文章:
- 我的AngularJS表达式没有'不起作用
- 在输入中存储AngularJS表达式结果
- 为什么javascript替换方法(没有regex)在angularjs表达式中不起作用来删除 
- Angularjs表达式未显示在ngDialog模板中
- AngularJS表达式未求值
- 使用angularjs表达式复选框
- 如何从json中检索angularjs表达式的数据
- 堆叠三元运算符在 Angularjs 表达式中不起作用
- 如何使真实&&angularjs表达式中的false等于true
- angularjs 表达式中的注释
- AngularJS 表达式不起作用
- AngularJS 表达式在将控制器添加到主体时停止工作
- AngularJS 表达式中的尾随双引号
- 具有多个参数的 AngularJS 表达式过滤器
- 是否可以在 iframe 内更新 angularjs 表达式
- AngularJS 表达式中的条件和循环
- 如何通过http将angularjs表达式内容作为查询字符串发送
- 使用jQuery脚本将CSS样式应用于angularjs表达式
- 将AngularJS表达式传递给PHP或Ajax替代方案
- Flask正在解析AngularJS表达式