javascript - IF and ELSE IF executable same time Angularjs -
$scope.closeok = function (e) { var xa = 0; if ($rootscope.viewimage==0&&$rootscope.opencaidat==1&&$rootscope.openthread==1&&xa==0) { $('#caidatkhixem').modal('hide'); xa=1; $rootscope.opencaidat = 0; $scope.$digest(); e.preventdefault(); e.stoppropagation(); return true; } else if ($rootscope.viewimage==0&&$rootscope.opencaidat==0&&$rootscope.openthread==1&&xa==0) { $rootscope.classhienthibaiviet = "modal animated fadeoutrightbig"; xa=1; $timeout(function () { $('#hienbaihome').modal('hide'); }, 1000); $rootscope.taptoexit = 1; $rootscope.openthread = 0; $scope.$digest(); e.preventdefault(); e.stoppropagation(); return true; } };
can explain me why 2 sections if , else if executable same time. want 1 of them executed.
please me. sorry english bad
Comments
Post a Comment