では適用しないNG-場合はここに私のHTML、中:NG-の場合は、私が更新する必要があるビュー
<div id="shyBoxII" ng-if="robot.robot" ng-class="background">
<div class="row"><i class="fa fa-user-plus"></i></div>
<div class="row"><i class="fa fa-book"></i></div>
<div class="row"><i class="fa fa-video-camera"></i></div>
<div class="row"><i class="fa fa-volume-up"></i></div>
</div>
しかし、私のコントローラでは、私はそれがtrue
を取得し、robot.robot
をログコンソールとまだ#shyBoxII
はしていません表示されます。何がありますか?
$scope.pinActiveSection = function ($event,section) {
var $element = $(".table-hover tr."+section+"");
console.log($event,section);
if($element.children(":first").hasClass("unlock")){
$(".table-hover tr:not(."+section+")").fadeOut("slow", function() {
$(this).remove();
$element.parent().parent().parent().css("top", "10%");
$element.parent().parent().parent().css("padding", "0%");
$scope.activeSection.activeSection = section;
$scope.robot.robot = true;
console.log($scope.robot.robot);
if($scope.activeSection == "I")
{
$scope.background.push("I");
$scope.background.push("show");
}
});
}
else{
$.fn.extend({
animateCss: function (animationName) {
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
$(this).addClass('animated ' + animationName).one(animationEnd, function() {
$(this).removeClass('animated ' + animationName);
});
}
});
$element.children(":first").animateCss('bounce');
}
};
明確にするため、$scope.pinActiveSection
が実行されている、私は$scope.robot.robot
がtrue
であることをコンソールログを参照してくださいので、私の見解では更新されない理由を私は理解していません。 $scope.robot.robot
をif
ブロックにプッシュすると動作しますが、私はfadeOut
コールバックの一部としてそれを使用します。助けてください!
編集:pinActiveSelection
を2回連続して実行すると、2回目の実行後に#shyBoxII
が表示されます。はじめて何がうまくいかないかについての手掛かりはありますか?
を、このコードを追加してください、あなたはNGリピート中または通常はこのコードを使用していますか? –
@ShailendraSinghDeol通常 –