【发布时间】:2015-02-17 18:00:43
【问题描述】:
我有使用休息服务的 json 响应现在我想使用 Angularjs 表达式绑定将该数据填充到我的 html 页面中,我试图在一个字段中获取数据但我未能呈现。任何帮助将不胜感激。
到目前为止,我已经尝试过这个......
HTML
<div ng-controller="lrrSearchModalCtrl" class="container">
<div class="row">
<label class="control-label">Jurisdiction</label>
<p>-EMEA -United</p>
<p>- Kingdom</p>
</div>
<div class="row">
<div class="col-md-6">
<label class="control-label">Rule Id</label>
<div>{{ ruleIdentifier.id }}</div>
</div>
<div class="col-md-6">
<label class="control-label">SubpartID</label>
<div>{{subpartId}}</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<label class="control-label">Rule Internal or Outsourced</label>
<div>Rule internal data</div>
</div>
<div class="col-md-6">
<label class="control-label">Subpart Internal or Outsourced</label>
<div>LRR Data one lorem i</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label class="control-label">Rule Citation</label>
<div>MSRB Gen Rule G-37</div>
</div>
<div class="col-md-6">
<label class="control-label">Subpart Citation</label>
<div>29 CFR 2550.401c-1</div>
</div>
</div>
</div>
searchCtrl.JS
$scope.lrrDetailWinOptions = lrrSearchGridConfig.modalLrrConfig;
$scope.showDetail = function (id){
$scope.selectedId = id;
$scope.lrrDetailWin.open().center();
}
ModalCTRL.JS
angular.module('thirdPartyManagementApp').controller('lrrSearchModalCtrl', function($scope,lrrDetails) {
'use strict';
var result = {
ruleIdentifier:{},
subpartId: {}
}
lrrDetails.findlrrDetail().then(function(response){
console.log(response);
})
$scope.ruleIdentifier = result.ruleIdentifier
$scope.subpartId = getLrrData.subpartId
$scope.showDetail = function(id){
}
});
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":{
"id":2,
"inventoryName":"Electronic Communication",
"erhKey":null,
"regInvetoryclassKey":null,
"ntrntlFlag":true},
"regulatoryInventoryClassfication":{
"id":1,
"classificationName":"Compliance",
"sponserWrokerKey":6411},
"geographicLocations":[
{"id":21598,
"sourceFeedKey":5,
"lookupCode":"RS_ACTIVE",
"externalIndintifier":"1",
"geoLocationTransactionKey":0,
"geoLocationCode":"USA",
"geoLocationName":"United States",
"geoLocationShortName":" ",
"regionIdentifier":1,
"regionName":"United States"}],
"enterpriseReportingHierarchies":[
{"id":161,
"erhTransactionKey":161,
"erhName":"Enterprise Privacy Compliance",
"erhShortName":"LCRR",
"erhLevelNumber":4,
"parentId":3320,
"level0Id":0,
"level0Name":"BAC Enterprise Wide",
"level1Id":804,
"level1Name":"Legal Compliance and Regulatory Relations",
"level2Id":167,
"level2Name":"Global Compliance",
"level3Id":3320,
"level3Name":"Enterprise Compliance",
"level4Id":175,
"level4Name":"Enterprise Privacy Compliance","activeIndicator":"1"}]}
【问题讨论】:
-
我无法将 json 数据显示为 html..
-
我是 angularjs 新手,我想知道控制器和 html 中的实现
-
“无法显示”是什么意思?一些错误?奇怪的结果?请注意,SO 不是一个教程的地方。这是为了帮助那些卡在他们的代码中的人。
-
我认为作为 angularjs 的新手,我被困在控制器的实现和使用表达式中,例如来自 json 的 ruleidentifier 响应我如何在 html 中获取 ruleidentifier 的值...我问的简单问题。跨度>
-
控制台有输出吗?