Skip to content

Instantly share code, notes, and snippets.

@ramansah
Created December 31, 2016 17:32
Show Gist options
  • Save ramansah/ed134fb8a4af41cb89a3c5bca2fa7752 to your computer and use it in GitHub Desktop.
Save ramansah/ed134fb8a4af41cb89a3c5bca2fa7752 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
@Component({
selector: 'income-query',
template: `
<div class='income-query'>
<input #income_input type='text' value='{{income}}' class='income-box'/>
<img (click)='breakup(income_input)' class='arrow-right' src='/resources/arrow-right.png'/>
</div>
`,
})
export class AppComponent {
income: Number;
constructor() {
this.income = 1000;
}
breakup(income_input: HTMLInputElement): void {
this.income = parseFloat(income_input.value);
console.log("Income : " + this.income);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment