Angularjs idle timeout auto go to lock screen
Hi Guys Today discussed Angularjs idle timeout Auto go to lock screen Frontend developer very looks and pretty sides example 5 mins or 10 mins without mouse overing and not working auto go to lock screen and then enter password go to continue work.
Html Page
This Page index page Main Controller Config and this controller used full application working this function. follows code controller code.
Controller.js
Angularjs idle timeout auto go to lock screen |
Html Page
This Page index page Main Controller Config and this controller used full application working this function. follows code controller code.
Controller.js
function Appctrl($scope, $interval, $document) {
var int = null;
var callbacks = [];
var idleTime = 0;
$scope.isIdle = function() {
return (idleTime > 0);
$state.go(app.lock);
};
angular.element($document).bind('mousemove', function(e) {
idleTime = 0;
$interval.cancel(int);
startInterval();
$scope.$apply();
});
function startInterval() {
int = $interval(function() {
idleTime += 3000;
}, 3000);
}
startInterval();
}
1 comments:
commentsI really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he ejoyed it as well! Little Rock Locksmith Pros
Reply