1

スマート テーブルで列ヘッダーが正しく並べ替えられません。個別にソートするのではなく、すべて一緒にソートします。

<thead>
    <tr>
        <th st-sort="field" ng-repeat="field in stat.q">{{field}}</th>
    </tr>
</thead>

これがジャバスクリプトです。

stat.q = ["Who is the coolest?", "What is your favorite color?", "Pick a movie", "Where do you want to go?", "test rating"];   
4

2 に答える 2

3

ng-repeat を使用するには、{{field}} を中括弧で囲む必要があります。

<thead>
  <tr>
    <th st-sort="{{field}}" ng-repeat="field in stat.q">{{field}}</th>
  </tr>
</thead>
于 2015-11-11T02:25:07.790 に答える