我正在学习Angular和Firebase。
使用以下数据:
ticket
|
|
-->uniqueidkjlkjaksjdlkfjasdf
|
|
-->ticket
| |
| |---> completed: false
| |---> description: asdf
|
--->username: asdf
HTML:
<div id="logDiv">
<div ng-repeat="(key,username) in dblogs">
<ul style="list-style-type: none;">
<li><label>Username:{{username}}</label>
<button class="destroy" ng-click="removeLog(key)">
X</button></li>
</ul>
</div>
</div>
我在页面上看到了这个:
Username:{"ticket":{"completed":false,"description":"asdf"},"username":"asdf"}
我们如何正确格式化数据?
答案 0 :(得分:0)
试试这个:
<div id="logDiv">
<div ng-repeat="(key,user) in dblogs">
<ul style="list-style-type: none;">
<li><label>Username:{{user.username}}</label>
<button class="destroy" ng-click="removeLog(key)">
X</button></li>
</ul>
</div>
</div>