Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
angular-simple-user-idle
Advanced tools
Changelog
1.0.0
Readme
Service for Angular 6+ to detect and control of user's idle.
This library is a fork of angular-user-idle by rednez
npm install angular-user-idle
In app.module.ts:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { UserIdleModule } from 'angular-user-idle';
import { AppComponent } from './app.component';
@NgModule({
imports: [
BrowserModule,
// Optionally you can set time for `idle`, `timeout` and `ping` in seconds.
// Default values: `idle` is 600 (10 minutes), `timeout` is 300 (5 minutes)
// and `ping` is 120 (2 minutes).
UserIdleModule.forRoot({idle: 600, timeout: 300, ping: 120})
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {}
You should init user idle service in one of core component or service of your app, for example login.component.ts:
import { Component, OnInit } from '@angular/core';
import { UserIdleService } from 'angular-user-idle';
@Component({
templateUrl: './login.component.jade'
})
export class LoginComponent implements OnInit {
readonly googlePlayLink: string;
readonly appStoreLink: string;
constructor(private userIdle: UserIdleService) {
}
ngOnInit() {
//Start watching for user inactivity.
this.userIdle.startWatching();
// Start watching when user idle is starting.
this.userIdle.onTimerStart().subscribe(count => console.log(count));
// Start watch when time is up.
this.userIdle.onTimeout().subscribe(() => console.log('Time is up!'));
}
stop() {
this.userIdle.stopTimer();
}
stopWatching() {
this.userIdle.stopWatching();
}
startWatching() {
this.userIdle.startWatching();
}
restart() {
this.userIdle.resetTimer();
}
}
startWatching(): void;
Start user idle service and configure it.
onTimerStart(): Observable<number>
Fired when timer is starting and return observable (stream) of timer's count.
onTimeout(): Observable<boolean>;
Fired when time is out and id user did not stop the timer.
stopTimer()
Stop timer.
resetTimer()
Reset timer after onTimeout() has been fired.
stopWatching()
Stop user idle service.
setConfigValues({idle, timeout, ping})
Set config values after module was initialized.
setCustomActivityEvents(customEvents: Observable<any>): void
Set custom activity events after module was initialized.
onTimerStart()
is fire and return countdown for 5 minutesstopTimer()
then time is up and onTimeout()
is fire.FAQs
User's idle service for Angular 6+
The npm package angular-simple-user-idle receives a total of 20 weekly downloads. As such, angular-simple-user-idle popularity was classified as not popular.
We found that angular-simple-user-idle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.