I am a beginner to angular2 / typescript I'm trying get numbers from two textboxes and adding both numbers and display the result using interpolation
@Component({
selector: 'my-app',
template:
`<h1>Hello {{name}}</h1>
<h1>{{D}}</h1>
<form>
<p>first number:<input type="text" id="num1"></p>
<p>second number:<input type ="text1" id="num2"></p>
<h1> {{result}}</h1>
</form>
<test-app></test-app>`
})
export class AppComponent
{
name = 'Angular';
value : number;value1 : number;result:number;
constructor(value : number,value1 : number,result:number)
{
this.value = parseFloat
((document.getElementById("text") as HTMLInputElement).value);
this.value1 = parseFloat((document.getElementById("text1")
as HTMLInputElement).value);
this.result=this.value+this.value1;
}}