title: How to assign empty value to input type number using Angularjs?
body: <p>I have an input type number. I want to set default value 1 if ng-model is null or empty or undefined. it works fine.
  But on the same page, I have a submit button. on click of this button, I'm just returning false for some validation fail. But when it returns after validation fails. my dropdown (input type number) shows empty value. I check the value of ng-model, it's empty.</p>
  
  <p>So if the value is not a proper number, I want it to set to 1 by default.</p>
  
  <pre><code>&lt;input type="number" step="1" min="1" onkeypress="return (event.charCode == 8 || event.charCode == 0) ? '': event.charCode &gt;= 48 &amp;&amp; event.charCode &lt;= 57" id="train_n_file" 
                                            ng-init="item.n_fold = item.n_fold || 1" ng-model="item.n_fold" ng-disabled="item.train_select=='training_time_range'" style="margin-top: -2px;" class="input-div" value="{{1}}"&gt;
  
  
  &lt;md-button ng-click="schedule_event()" type=submit id="step-btn" class="build-model md-raised step-btn md-primary md-button md-ink-ripple"&gt; Schedule &lt;/md-button&gt;
  
  
   $scope.schedule_event = function () {
    if (some condition) {
        $scope.showAlert('Please pick schedule frequency.');
        return false;
    }
  </code></pre>