Just starting out with angular2, so please be patient with me. I realize this might be a beginner's 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(){
// retrieve all input values here.
}
}
Here is what I have attempted:
let vb = balance.viewBy,
df = balance.dateFrom,
dt = balance.dateTo;
// encountered an error
In angular1, we could access these values using $scope.
Any assistance on this would be greatly appreciated. Thank you.