【问题标题】:ui-sref include parameter in ng-repeat loopui-sref 在 ng-repeat 循环中包含参数
【发布时间】:2016-10-19 13:48:12
【问题描述】:

我有这张桌子:

            <table class="table tenant-table text-center">
                <thead>
                    <tr>
                        <th class="text-center">
                            <i class="fa fa-per"></i> Date
                        </th>
                        <th class="text-center">
                            <i class="fa fa-calendar"></i> Result
                        </th>
                        <th> </th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="(k, v) in loanapps track by $index">
                        <td data-th="Date">{{v.ApplicationDate | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                        <td data-th="Result">
                          <a ng-if="v.LoanStatus == 'Approved'" ui-sref="approved({loanid: {{v.ApplicationId}}})" class="btn dark btn-sm btn-outline sbold uppercase">
                            <i class="fa fa-share"></i> View
                          </a>
                        </td>
                    </tr>

                </tbody>
            </table>

我正在尝试包含一个参数,即已批准重定向的应用程序 ID,但我无法在 url 中包含该值。我采用的 ui-sref 方法是正确的还是需要做一些调整?

【问题讨论】:

标签: angularjs angularjs-scope angular-ui-router angularjs-ng-repeat angular-routing


【解决方案1】:

刚刚遇到同样的问题。希望我能找到更好的方法,但现在这可行:

approved({loanid: '{{v.ApplicationId}}'})

【讨论】:

    猜你喜欢
    • 2016-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-27
    • 1970-01-01
    • 2016-07-05
    • 2019-08-23
    相关资源
    最近更新 更多