I am new in angular2. So, please bear with me. I know this is a noob question for some.
<form>
<label class="input-group">
<p>View By</p>
<select [(ngModel)]="balance.viewBy" name="viewBy">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</label>
<label class="input-group">
<p>Date From</p>
<input [(ngModel)]="balance.dateFrom" name="dateFrom"/>
</label>
<label class="input-group">
<p>Date To</p>
<input [(ngModel)]="balance.dateTo" name="dateTo"/>
</label>
<button type="button" (click)="search_data_balance()">Search</button>
</form>
component.ts
export class BalanceComponent {
search_data_balance(){
// get all input value.
}
}
What I have tried so far
let vb = balance.viewBy,
df = balance.dateFrom,
dt = balance.dateTo;
// returns error
In angular1, we can get the value of those using $scope.
Any help would be appreciated. Thanks.