Angularjs 按$index发行的角度轨迹

Angularjs 按$index发行的角度轨迹,angularjs,Angularjs,我正在使用ng repeat呈现我的html,下面是代码片段 <ul> <li ng-repeat="feed in feeds | orderBy:'title'"> <p class="status-text"> {{feed.title}} <a ng-href={{feed.link}} class="status-url"> {{feed.link}}

我正在使用ng repeat呈现我的html,下面是代码片段

<ul>
  <li ng-repeat="feed in feeds  | orderBy:'title'">
    <p class="status-text">
        {{feed.title}}
        <a ng-href={{feed.link}} class="status-url">
         {{feed.link}}      
       </a>
    </p>
  </li>
</ul>
  • {{feed.title}

这成功地对列表进行了排序,但出现了一个错误,错误:[ng repeat dups]。我查看了文档,并将ng repeat行修改为

<li class="live_mvc_element" ng-repeat="feed in feeds track by $index | orderBy:'title'">

  • 我添加了trackby$index,错误被解决了,但是现在还没有排序。什么解决方案可以解决错误并对列表进行排序???

    尝试以下操作:
    feed-in-feed | orderBy:'title'track by$index“


    来源:

    将轨迹按部分移动到orderBy之后的末尾。这是一个已知问题,仅供参考。角度文档已更新,以显示它必须位于语句末尾。