使用angular获取JSON数据

时间:2016-05-08 11:51:12

标签: angularjs json

请帮助在单页中使用Angular两个数组获取JSON编码数据。 请查看以下JSON_Encoded数据

[{"id":"25","rClientName":"Pravin Ingle","rContactNumber":"1234567890","rCompanyName":"Pro IT Technology","rEmail":"harshad.patil@proittechnology.com","rRequirement":"Requirement"}]

[{"id":"25","dSelectDomain":"DOmain","dDomainName":"DOmain","dRegisterDomainFrom":"DOmain","dStartDate":"DOmain","dEndDate":"DOmain","dRegistrationFor":"DOmain"}]

谢谢你, Harshad

1 个答案:

答案 0 :(得分:0)

尝试处理$ scope.data,例如:

 <div ng-controller="myCtrl">
  <ul ng-repeat="item in data">
    <li>{{item.rClientName}}</li> 
    <li>{{item.rContactNumber}}</li>
    <li>{{item.rCompanyName}}</li>
    <li>{{item.rEmail}}</li>
    <li>{{item.rRequirement}}</li>
  </ul>
</div>


$scope.data = [{"id":"25",
            "rClientName":"PravinIngle",
            "rContactNumber":"1234567890",
            "rCompanyName":"Pro IT Technology",
            "rEmail":"harshad.patil@proittechnology.com",
            "rRequirement":"Requirement"
          }]

详细信息: http://jsfiddle.net/oxyjunkhead/bkUEu/3398/