在模型工厂中更新后,只有一个属性在成功后放在orderBy中才能正常工作,当尝试更新多于一个属性而不是orderBy时,如何在成功后更新多个属性?
o.vote = function(post) {
return $http.put('/posts/' + post.id + '/upvote').success(function(data) {
post.points = data.points;
// post.votes = data.votes;
});
}
查看:
<div ng-repeat="post in posts | orderBy:'-points'">