Create Addition Program in Angular Framework

0
Create Addition Program in Angular Framework:-
Angular Framework provides Typescript or additional javascript code patterns to write code.
Typescript provides Object-Oriented JavaScript to write code.

1)Create Component provide name addition
2) write code on Typescript file using this pattern under Constructor()

export class AdditionComponent implements OnInit {
  a=100
  b=200
  c=0

  constructor() {
  alert("addition is "+(this.a+this.b));
  this.c = this.a+this.b

  }
  ngOnInit() {
 // alert("ON INIT");
  }


}
3) Create HTML File and Write Code to view data


{{c}}

Post a Comment

0Comments

POST Answer of Questions and ASK to Doubt

Post a Comment (0)