ng-switch-when 与 ng-repeat [英] ng-switch-when with ng-repeat

查看:19
本文介绍了ng-switch-when 与 ng-repeat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 HTML 代码是

My HTML code is

<tr ng-switch-when="true" ng-repeat="onlineCredentials in onlineCredentialDetails" >
        <td>
            <span>Ordering Mode: </span>{{onlineCredentials.mode}}<br />
            <span>Intermedtiary Group: </span>{{onlineCredentials.name}}
        </td>
        <td>
            <span>Website: </span>{{onlineCredentials.webSite}}
        </td>
        <td >
            <span>Username / Password</span>
            <div ng-repeat="cred in onlineCredentials.loginDetails">
                -&nbsp;{{cred.userName}}&nbsp;/&nbsp;{{cred.password}}
            </div><br />
        </td>
    </tr>

哪个不是绑定数据...(存在 TD 和文本但绑定属性值为空)

Which is not binding data... (TD s and text is present but binding property values are empty)

如何同时使用 ng-switch-when 和 ng-repeat?

How to work with ng-switch-when and ng-repeat at a time?

提前致谢

推荐答案

这是设计使然.请参阅https://stackoverflow.com/a/15434085/1264360.基本上要修复,您需要在 ng-repeat 上方的元素中使用 ng-switch-when.

This is by design. Please see https://stackoverflow.com/a/15434085/1264360. Basically to fix you need to have the ng-switch-when in an element above the ng-repeat.

这篇关于ng-switch-when 与 ng-repeat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆