如何在HTML上的AngularJS中使用foreach

Mik*_*hun 2 html javascript angularjs angularjs-ng-repeat

如何在angular js中使用foreach语句?我当前的数据以json格式打印出来。我想将其打印在新行上。

HTML

<p>{{controller.greeting.custinfo}}</p>

 //attempt
<p ng-repeat= >{{controller.greeting.custinfo}}</p>
Run Code Online (Sandbox Code Playgroud)

在UI上输出

{"id":null,"biling_address":"null","billing_state":"FL","ip_Addresses":["123:111:2101","","NULL"],name":"jimmmy"}
Run Code Online (Sandbox Code Playgroud)

Java输出

System.out.println(custinfo);
demo.model.cert@ba1983a
Run Code Online (Sandbox Code Playgroud)

如何使用foreach语句以换行显示数据?而不是json格式。

我知道如何用百里香叶做到这一点,下面的例子

<table th:each="custinfo : ${custinfo}">

  <tr>
        <td ng-show="id" class="padded">id:</td>
        <td ng-show="id" th:text="${custinfo.id}" class="padded"></td>
  </tr>
  //continue down
Run Code Online (Sandbox Code Playgroud)

lin*_*lin 5

只需循环:

 <p ng-repeat="(key, value) in controller.greeting.custinfo">{{key}}: {{value}}</p>
Run Code Online (Sandbox Code Playgroud)