Angular 7 Calculator
Hello friends lets see how I developed this calculator step by step. I have shared the source code in the end:
- First install Angular latest CLI. For this open your teminal/command prompt: npm install -g @angular/cli
- Create a new angular project : ng new calculator
- Lets create a calculator component: ng n c calculator.
- app.module.ts
I have imported FormsModule and registered in imports of NgModule decorator. This is used for the ngModel binding
5. Now lets start building our calculator in calculator component:
Here I have written the html content of the calculator
calculator.component.html
6. calculator.component.ts
Here I have written the calculator logic
7. I have shared the video sharing the output of the code
Github link — https://github.com/AmirMustafa/Calculator-with-Angular-7