1.0.8 • Published 7 years ago
ngx-calculator v1.0.8
NgxCalculator - A simple calculator for Angular projects
Overview
The calculator uses Javascript's eval() to evaluate math expressions, generating a number value as result, which can be binded using ngModel in your application for many purposes.
You can try the calculator online at http://lucashsilva.github.io/ngx-calculator/ or clone the repo and run the development server.
Feel free to contribute opening a pull request :)
Screenshot

Installing and using
- Install the package from npm via command line:
npm install --save ngx-calculator- Add
NgxCalculatorModuleas an import of your app module:
import { NgxCalculatorModule } from './ngx-calculator/ngx-calculator.module';
@NgModule({
...
imports: [
NgxCalculatorModule
],
...
})- Use the component in your HTML template:
<ngx-calculator [(ngModel)]="value"></ngx-calculator>Notice that the binding is optional and that the bind value will only change when = is pressed.
Development server
Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.