ng2-timeout-dialog
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

ng2-timeout-dialog

Timeout dialog for your Angular applications.

DEMO https://msarsha.github.io/ng2-timeout-dialog/

How to use

  • npm install --save ng2-timeout-dialog
  • import ShTimeoutModule into your app module

markup:

<sh-timeout [timeoutAfter]="10" [warningAfter]="2" (timeout)="onTimeout()">
  <h1>Custom warning dialog content</h1>
</sh-timeout>

component:

  @Component({
      ...
  })
  export class MyComponent{
    onTimeout(){
      alert('timeout event fired!');
    }
  }

Any mouse click or key press will reset the timeout counting.

Properties:

[timeoutAfter] (seconds) - Number of seconds the timeout event will be fired after.

[warningAfter] (seconds) - Optional property to show a dialog before the timeout event is fired.

(timeout) - Will be fired after the time defined in timeoutAfter.

Package Sidebar

Install

npm i ng2-timeout-dialog

Weekly Downloads

1

Version

0.1.1

License

ISC

Last publish

Collaborators

  • msarsha