我希望我的订单能够评估表达式
目前我有:
ng_repeat: "post in posts | orderBy:"up_votes"
我想通过{{up_votes - down_votes}}
订购答案 0 :(得分:6)
ng_repeat: "post in posts | orderBy:'down_votes - up_votes'"
只需使用单引号来包装orderBy
的表达式或者您可以将voteDiff函数添加到控制器并执行orderBy:voteDiff