私の見解は次のように書かれています。
<ul class="commentslist cf">
<li class="cf" ng-repeat="(key,comment) in activity.comments">
<div class="comment">{{comment.name}}
<div class="buttons" ng-show="isPostedUser(activity.$id, key, currentUser)">
<button class="btn btn-delete tooltip"
confirmation-needed = "Are you sure you want to delete this activity?"
ng-click="deleteComment(activity.$id,key)">
<span>Delete this comment</span></button>
</div><!-- buttons -->
</div><!-- comment -->
</li>
</ul>
このビューに関連付けられているコントローラーには、次の関数があります。
$scope.isPostedUser = function(actId, key, user) {
var refComment = new Firebase(FIREBASE_URL + "users/" + $scope.whichuser + "/activities/" + actId +
"/comments/" + key);
var commentObj = $firebase(refComment).$asObject();
commentObj.$bindTo($scope, "data").then(function() {
return $scope.data.giver === user.$id;
});
};
この関数の目的は、isPostedUser が true と評価された場合にのみ削除ボタンを表示することです。テストしたところ、true と評価されましたが、まだボタンが表示されません。理由はありますか?