1.0.2 • Published 5 years ago

ngx-stopwatch v1.0.2

Weekly downloads
10
License
MIT
Repository
github
Last release
5 years ago

Ngx-Stopwatch 1.0.1

Minimalistic stopwatch for Angular applications

GitHub GitHub tag (latest by date) GitHub repo size npm bundle size npm

Support

GitHub stars GitHub followers

Table of contents

Details

There's a showcase project with different examples on how to use the library. I don't think you'll have any problems using it in your projects. I aimed at keeping it simple yet flexible.

Feel free to comment, fork or submit a pull request.

Installation

ngx-stopwatch is available via npm

Using npm:

$ npm install ngx-stopwatch --save

Usage

Import NgxStopwatchModule in in the root module(AppModule):

// Import library module
import { NgxStopwatchModule } from 'ngx-stopwatch';

@NgModule({
  imports: [
    ...,
    NgxStopwatchModule
  ]
})
export class AppModule { }

Add NgxStopwatchService service wherever you want to use the ngx-stopwatch.

import { NgxStopwatchService } from 'ngx-stopwatch';

class AppComponent {
  constructor(protected stopwatchService: NgxStopwatchService) {}

  start() {
    this.stopwatchService.start();
  }

  reset() {
    this.stopwatchService.reset();
  }
}

You can now place it in your templates like this:

<ngx-stopwatch></ngx-stopwatch>

You can find more examples in the showcase project.