Skip to content

Commit 776fa44

Browse files
committed
Update README
1 parent 6f9ae54 commit 776fa44

File tree

1 file changed

+62
-6
lines changed

1 file changed

+62
-6
lines changed

README.md

+62-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,60 @@
1-
# NgCircleTimer
1+
# Angular Circle Countdown Timer Component
22

3-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.0.
3+
Flexible, lightweight, easy-to-use, without external dependencies and generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.5.
44

5-
## Code scaffolding
5+
### Install it
6+
```npm install --save ng-circle-timer```
67

7-
Run `ng generate component component-name --project ng-circle-timer` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ng-circle-timer`.
8-
> Note: Don't forget to add `--project ng-circle-timer` or else it will be added to the default project in your `angular.json` file.
8+
------------------------
9+
## How to use it
910

10-
## Build
11+
You can use it by importing it into app.module.ts.
12+
```
13+
import { NgCircleTimerModule } from 'ng-circle-timer';
14+
15+
`@NgModule({
16+
imports: [NgCircleTimerModule],
17+
declarations: [],
18+
providers: [],
19+
})
20+
export class AppModule { }
21+
```
22+
In case you are also using lazy loading pages, check if your pages have a module file, e.g. `otp.module.ts`. If they do, import `NgCircleTimerModule` into the module of each page where you are going to use it.
23+
```
24+
@NgModule({
25+
imports: [
26+
CommonModule,
27+
.....
28+
NgCircleTimerModule,
29+
],
30+
declarations: [OtpPage]
31+
})
32+
export class OtpPageModule {
33+
}
34+
```
35+
Once imported, it is ready for use. You can use it in your page controller file as follows:
36+
37+
```
38+
@Component({
39+
selector: 'ngx-otp',
40+
templateUrl: './otp.page.html',
41+
styleUrls: ['./otp.page.scss'],
42+
})
43+
export class OtpPage implements OnInit, OnDestroy {
44+
@ViewChild('timer', {static: false}) timer: NgCircleTimerComponent;
45+
canSendCode: boolean = false;
46+
constructor() {
47+
}
48+
49+
onTimeComplete: (event: Emoji) => {
50+
that.canSendCode = false;
51+
};
52+
}
53+
```
54+
And in your page html file as follows:
55+
```<ng-circle-timer #timer [duration]="60" (onComplete)="onTimeComplete($event)"></ng-circle-timer>```
56+
57+
## Building
1158

1259
Run `ng build ng-circle-timer` to build the project. The build artifacts will be stored in the `dist/` directory.
1360

@@ -22,3 +69,12 @@ Run `ng test ng-circle-timer` to execute the unit tests via [Karma](https://karm
2269
## Further help
2370

2471
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
72+
73+
74+
## Credits
75+
- [Alberto Rial Barreiro](https://github.com/alberto-rial)
76+
- [Jacobo Cantorna Cigarrán](https://github.com/jcancig)
77+
- [Desarrollo de apps para moviles](https://squareet.com/desarrollo-de-aplicaciones-para-moviles) SquareetLabs
78+
79+
## License
80+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

0 commit comments

Comments
 (0)