Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望我的 orderBy 评估一个表达式
目前我有:
ng_repeat: "post in posts | orderBy:"up_votes"
我希望它改为按 {{up_votes - down_votes}} 订购
ng_repeat: "post in posts | orderBy:'down_votes - up_votes'"
只需使用单引号来包装 orderBy 的表达式
或者您可以向控制器添加一个 voteDiff 函数并执行orderBy:voteDiff
orderBy:voteDiff