ngx-stopwatch
v1.0.2
Published
Minimalistic stopwatch for Angular applications
Downloads
38
Maintainers
Readme
Ngx-Stopwatch 1.0.1
Minimalistic stopwatch for Angular applications
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.