UNPKG

zettapi_client

Version:

Client side CRUD operations in angular to use with zettapi_server rest api to get started quickly in any CMS project

22 lines (18 loc) 593 B
app.directive('zlIdle', function () { return { restrict: 'A', scope: true, controller: function ($scope, $location, $auth) { $scope.$on('IdleStart', function () { swal("Atenção", "Devido à sua inactividade irá ser disconectado em 5 segundos", "info"); }); $scope.$on('IdleEnd', function () { console.log('IdleEnd'); }); $scope.$on('IdleTimeout', function () { $auth.logout(); $location.path('/'); }); } }; });