首页 > 解决方案 > 以角度在节点红色 ui-template 中传递消息时,UI 消失

问题描述

我有一个很大的列表,我使用 ui 模板将其格式化为 Node-Red Dashboard 中的表格。我对每一行使用 md-button 来生成一个按钮,以便用户可以对表格中的该行执行某些操作。我的模板相当简单:

<style>
tr:nth-child(even) {background: #cce6ff; vertical-align: text-top; border-bottom: 1px solid #6699ff;}
tr:nth-child(odd) {background: #fffff; vertical-align: text-top; border-bottom: 1px solid #6699ff;}
</style>
<div height="250" style="height: 250px;">
    <table>
        <tr><th>Time</th><th>Title</th><th>Description</th><th>Action</th></tr>
        <tr ng-repeat="row in msg.payload track by $index">
            <td style="white-space: nowrap">{{row.peTime}}</td>
            <td style="white-space: nowrap">{{row.peTitle}}</td>
            <td>{{row.peLong}}</td>
            <td><md-button ng-click="send({payload: row.peTime});">Click me</md-button>
            </td>
        </tr>
    </table>
</div>

UI 中的一切看起来都很好,但是当我有时单击按钮时,有时单击几下后,整个表格内容就会从浏览器中消失。我不确定我做错了什么。会不会是某个组件过时了?我在这里有一个完整的示例流程:https ://pastebin.com/cibBa5NG

标签: angularjsnode-red

解决方案


推荐阅读