That's the way I would like to get this done, for example, if you close a pop-up window for 2 days in a short time, for example, 1 or 2, it should not do it again until 190 days.
var app = angular.module('PopUpUsers', []);
app.controller('ViewPopUp', ['$scope', '$timeout', function ($scope, $timeout) {
$timeout(function () {
$scope.PopUpViewDiv = true;
}, 12500);
$scope.ClosePopUp = function () {
$scope.PopUpViewDiv = false;
};
}]);
What I think I have to overlook right now and here it is counter to how many times you have clicked on close area and remember it in some form of cookies.
The problem is just: How do I get done so that they can remember how many times popup has closed?
Update code:
var app = angular.module('PopUpUsers', []);
app.controller('ViewPopUp', ['$scope', '$timeout', '$cookies', function ($scope, $timeout, $cookies) {
var cookieWObject = $cookies.getObject('test');
var count = 3;
if (cookieWObject == count) {
$scope.PopUpViewDiv = false;
} else {
$timeout(function() {
$scope.PopUpViewDiv = true;
}, 12500);
$scope.ClosePopUp = function () {
$scope.PopUpViewDiv = false;
$cookies.putObject("test", count);
};
}
}]);