i'm having 2 select fields and number of input fields as scope object properties
$scope.resetAll=function(){
$scope.tableVal=0;
};
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<select ng-model="tableVal.portfolio" ng-change="getProjectPhase(tableVal.portfolio)" class="form-control portfolioSelect" id="sel1" style="margin-top: -3px;">
<option>blah blah<option>
<select ng-model="tableVal.project" ng-options="v as v for (k,v) in selectOptions" class="form-control projectPhaseSelect" id="sel3" style="margin-top: -3px;">
<option>blah blah<option>
</select>
<td>$<input id="testingInput" type="number"step="0.02" ng-disabled="!tableVal.project" ng-model="tableVal.Prevention"> </td>
<td>$<input id="testingInput" type="number" step="0.02" ng-disabled="!tableVal.project" ng-model="tableVal.Appraisal"> </td>
<td>$<input id="testingInput" type="number" step="0.02" ng-disabled="!tableVal.project" ng-model="tableVal.InternalFailure"> </td>
<button type="button" class="btn btn-primary" ng-click="resetAll()"style="margin-top: -11px;">RESET</button>
when i click reset button the $scope.tableVal=0; resets all the field, but in my case i want select values not to be replaced, i somehow managed to get the values and set it manually, but no use
function(portfolio,project){
$scope.tableVal=0;
$scope.tableVal.portfolio=portfolio;
$scope.tableVal.project=project;
}
how to resolve this