ng-repeat出来的结果,需要再次进行处理

<table class="grain-record grain-list">
                <tr ng-repeat="list in prolist">
                    <td width="20%" class="text-center">{{$index+1}}</td>
                    <td width="25%" class="text-center">
                        <!--{{list.type=='1'?'签到获取': list.type=='2'?'投资获取': list.type=='3'?'推广邀请人投资获取': list.type=='4'?'注册获取': list.type=='5'?'邀请好友注册获取 ': list.type=='6'?'猫粮购买月账户': list.type=='7'?'猫粮获得利息': list.type=='8'?'猫粮提现'}}-->
                        <!--{{type}}-->
                        ***{{list.type}}***
                    </td>
                    <td width="25%" class="text-center">{{list.cat_menoy}}</td>
                    <td width="30%" class="text-center">{{list.create_time}}</td>
                </tr>
            </table>

如上代码:ng-repeat出来的结果 list.type返回值为1-7的字符串,对应的是7种方式,现在需要在html页面显示的是1-7对应的文字,请问该如何解决?

阅读 3.1k
1 个回答
<table class="grain-record grain-list">
    <tr ng-repeat="list in prolist">
        <td width="20%" class="text-center">{{$index+1}}</td>
        <td width="25%" class="text-center" ng-switch="list.type">
            <span ng-case-when="1">签到获取</span>
            <span ng-case-when="2">投资获取</span>
            <span ng-case-when="3">推广邀请人投资获取</span>
            <span ng-case-when="4">注册获取</span>
            <span ng-case-when="5">邀请好友注册获取</span>
            <span ng-case-when="6">猫粮购买月账户</span>
            <span ng-case-when="7">猫粮获得利息</span>
            <span ng-case-when="8">猫粮提现</span>
        </td>
        <td width="25%" class="text-center">{{list.cat_menoy}}</td>
        <td width="30%" class="text-center">{{list.create_time}}</td>
    </tr>
</table>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进