$scope.hasAll = false;
$scope.hasFirst = false;
$scope.hasSecond = false;
$scope.hasThird = false;
$scope.toggleAll = function () {
$scope.hasAll = !$scope.hasAll;
console.log($scope.hasAll);
var dynamicValue = $scope.hasAll;
$scope.hasFirst = dynamicValue;
$scope.hasSecond = dynamicValue;
$scope.hasThird = dynamicValue;
}
$scope.toggleFirst = function () {
$scope.hasFirst = !$scope.hasFirst;
checkAll();
}
$scope.toggleSecond = function () {
$scope.hasSecond = !$scope.hasSecond;
checkAll();
}
$scope.toggleThird = function () {
$scope.hasThird = !$scope.hasThird;
checkAll();
}
function checkAll() {
if ($scope.hasFirst == true && $scope.hasSecond == true && $scope.hasThird == true) {
console.log("123ok");
$scope.hasAll = true;
} else {
console.log("123no");
$scope.hasAll = false;
}
}
})