ngx-numaric-keypad
Version:
This is a two in one features keypad, you can use this as calculator also by just enabling that feature.
58 lines (42 loc) • 1.19 kB
Markdown
This is a two in one features keypad, you can use this as calculator also by just enabling that feature.
npm i ngx-number-keypad --save
import in your app.module.ts file
```
...
import { KeypadModule } from 'ngx-numaric-keypad';
...
@NgModule({
declarations: [
...
],
imports: [
...
KeypadModule,
...
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```
then put below component in your view, and if you want to use calculator then make that **calc = true** otherwise you can remove that param or make it **calc = false**.
```
<ngx-numaric-keypad
[]="true"
(getVal)="yourFunctionName($event)"
>
</ngx-numaric-keypad>
```
Now create function in your component.ts file
```
yourFunctionName(numberOutput: number) {
console.log(numberOutput) // you will have your keypad output here
}
```

MIT © [Sumit Patel](https://github.com/sumitLKpatel)