8000 GitHub - akocmark/angular-idleness: A simple, ultra-lighweigth angular service whice executes callbacks when user goes idle or active · GitHub
[go: up one dir, main page]

Skip to content

About

A simple, ultra-lighweigth angular service whice executes callbacks when user goes idle or active

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

angular-idleness

A simple, ultra-lighweigth (1.3kb) angular service whice executes callbacks when user goes idle or active

Demo

TODO

Installation

Installation is easy as Idleness has no dependencies.

Install with Bower

$ bower install angular-idleness

Adding dependency to your project

When you are done downloading all this, the only remaining part is to add dependencies on the angular-idleness AngularJS module:

angular.module('myModule', ['angular-idleness']);

This was tested to work with the following browsers:

  • Chrome
  • Latest Firefox
  • IE 8, 9, 10 and 11
  • Opera

Also Tested on Galaxy S3 Mobile Android (4.3) using Mobile Chrome, Firefox Mobile, Opera Mini, and the Stock Android

Modern mobile browsers should work without problems.

Usage

On your run blocks

app.run(function (idleness) {
  idleness.observe();
});

Controller

app.controller('MyController', function (idleness) {
  idleness.onIdle(function() {
    console.log('i am idle :(');
  }, function() {
    alert('i am alive');
  });
});

Or you can explicitly set the onIdle and onNotIdle functions

app.controller('MyController', function ($rootScope, idleness) {
  idleness. {
    $rootScope.idle = true;
  };
  idleness. {
    $rootScope.idle = false;
  };
});

About

A simple, ultra-lighweigth angular service whice executes callbacks when user goes idle or active

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

0