In this code snippet, I have set up ng-model to pass filter into my function and retrieve all user selections. Initially, I believed it could also be used to prefill or default the data. However, I am facing issues with this approach. Here is an excerpt from my controller:
.controller('ListCtrl', [
'$scope', '$filter', '$location', 'context', 'breeze', 'Service',
function ($scope, $filter, $location, context, breeze, Service) {
$scope.pageLoaded = true;
$scope.lists = [];
$scope.DDL1 = '';
$scope.filter = {
fromDate: '2015-05-01',
toDate: '',
sales: false
};
Below is a snippet of the corresponding HTML:
<md-content ng-controller="ListCtrl" layout="column" flex class="md-padding">
<md-tabs class="md-primary clearfix" md-selected="0" flex>
<md-tab label="Lists">
<table><tr>
<td width="10%">From Date: </td>
<td width="40%"><input type="date" ng-model="filter.fromDate" value="{{filter.fromDate}}"/></td>
<td width="10%">SParts: </td>
<td width="40%">
<input type="radio" name="sales" ng-model="filter.sales" value="true"> yes
<input type="radio" name="sales" ng-model="filter.sales" value="false" checked> no
</td>...